diff --git a/src/masternodes/mn_checks.cpp b/src/masternodes/mn_checks.cpp index 6fc1ad4c09b..5eea4abb8fe 100644 --- a/src/masternodes/mn_checks.cpp +++ b/src/masternodes/mn_checks.cpp @@ -1570,6 +1570,10 @@ class CCustomTxApplyVisitor : public CCustomTxVisitor { Require(token->symbol == "BTC" && token->name == "Bitcoin" && token->IsDAT(), "Only Bitcoin can be swapped in " + obj.name); + if (height >= static_cast(consensus.NextNetworkUpgradeHeight)) { + mnview.CalculateOwnerRewards(script, height); + } + Require(mnview.SubBalance(script, {id, amount})); const CTokenCurrencyPair btcUsd{"BTC", "USD"}; @@ -3130,6 +3134,10 @@ class CCustomTxApplyVisitor : public CCustomTxVisitor { } } + if (height >= static_cast(consensus.NextNetworkUpgradeHeight)) { + mnview.CalculateOwnerRewards(obj.to, height); + } + return mnview.AddBalance(obj.to, obj.amount); } diff --git a/src/masternodes/validation.cpp b/src/masternodes/validation.cpp index 01f63ad240e..6256e958d74 100644 --- a/src/masternodes/validation.cpp +++ b/src/masternodes/validation.cpp @@ -2186,6 +2186,11 @@ static void ProcessProposalEvents(const CBlockIndex* pindex, CCustomCSView& cach if (!res) { LogPrintf("Proposal fee redistribution failed: %s Address: %s Amount: %d\n", res.msg, scriptPubKey.GetHex(), amountPerVoter); } + + if (pindex->nHeight >= chainparams.GetConsensus().NextNetworkUpgradeHeight) { + subView.CalculateOwnerRewards(scriptPubKey, pindex->nHeight); + } + subView.Flush(); }