From ff550563b7915a7042169dabf6e555835a5b36c3 Mon Sep 17 00:00:00 2001 From: Anthony Fieroni Date: Sat, 7 May 2022 13:04:43 +0300 Subject: [PATCH] Calculate owner rewards for futures (#1201) Signed-off-by: Anthony Fieroni --- src/masternodes/consensus/smartcontracts.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/masternodes/consensus/smartcontracts.cpp b/src/masternodes/consensus/smartcontracts.cpp index 17d452a8cef..77b157384ed 100644 --- a/src/masternodes/consensus/smartcontracts.cpp +++ b/src/masternodes/consensus/smartcontracts.cpp @@ -172,6 +172,10 @@ Res CSmartContractsConsensus::operator()(const CFutureSwapMessage& obj) const { if (!res) return res; } else { + // some txs might be rejected due to not enough owner amount + if (static_cast(height) >= consensus.GreatWorldHeight) + CalculateOwnerRewards(obj.owner); + auto res = TransferTokenBalance(obj.source.nTokenId, obj.source.nValue, obj.owner, *contractAddressValue); if (!res) return res;