diff --git a/src/validation.cpp b/src/validation.cpp index 34001b5e4c0..e74189971c2 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -2223,34 +2223,23 @@ void ReverseGeneralCoinbaseTx(CCustomCSView & mnview, int height, const Consensu // Remove Loan and Options balances from Unallocated if ((height < Params().GetConsensus().FortCanningHeight && kv.first == CommunityAccountType::Loan) || - (height < consensus.GrandCentralHeight && kv.first == CommunityAccountType::Options)) + kv.first == CommunityAccountType::Options) { mnview.SubCommunityBalance(CommunityAccountType::Unallocated, subsidy); } else { - if (height >= consensus.GrandCentralHeight) + if (height >= consensus.GrandCentralHeight && kv.first == CommunityAccountType::CommunityDevFunds) { - const auto attributes = mnview.GetAttributes(); - assert(attributes); - - if (kv.first == CommunityAccountType::CommunityDevFunds) { - CDataStructureV0 enabledKey{AttributeTypes::Param, ParamIDs::Feature, DFIPKeys::GovernanceEnabled}; - - if (!attributes->GetValue(enabledKey, false)) - { - mnview.SubBalance(consensus.foundationShareScript, {DCT_ID{0}, subsidy}); + CDataStructureV0 enabledKey{AttributeTypes::Param, ParamIDs::Feature, DFIPKeys::GovernanceEnabled}; - continue; - } - } else if (kv.first == CommunityAccountType::Unallocated || kv.first == CommunityAccountType::Options) { - CDataStructureV0 enabledKey{AttributeTypes::Param, ParamIDs::Feature, DFIPKeys::EmissionUnusedFund}; - - if (attributes->GetValue(enabledKey, false)) { - mnview.SubBalance(consensus.unusedEmission, {DCT_ID{0}, subsidy}); - } else { - mnview.SubCommunityBalance(CommunityAccountType::Unallocated, subsidy); - } + auto attributes = mnview.GetAttributes(); + if (!attributes) { + return; + } + if (!attributes->GetValue(enabledKey, false)) + { + mnview.SubBalance(consensus.foundationShareScript, {DCT_ID{0}, subsidy}); continue; }