From 4d373ea7636e4321a0047a99a94d29cee4f0c0f6 Mon Sep 17 00:00:00 2001 From: Prasanna Loganathar Date: Thu, 26 May 2022 18:31:43 +0530 Subject: [PATCH] Fix for future swap owner rewards calc (#1293) * Fix for future swap owner rewards calc * Add fork condition * Update mn_checks.cpp --- src/masternodes/mn_checks.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/masternodes/mn_checks.cpp b/src/masternodes/mn_checks.cpp index 37c432ac4d..c1f7f104d0 100644 --- a/src/masternodes/mn_checks.cpp +++ b/src/masternodes/mn_checks.cpp @@ -1542,6 +1542,12 @@ class CCustomTxApplyVisitor : public CCustomTxVisitor CDataStructureV0 liveKey{AttributeTypes::Live, ParamIDs::Economy, EconomyKeys::DFIP2203Current}; auto balances = attributes->GetValue(liveKey, CBalances{}); + // Can be removed after the hard fork, since it will be backward compatible + // but have to keep it around for pre 2.8.0 nodes for now + if (height >= static_cast(consensus.FortCanningCrunchHeight)) { + CalculateOwnerRewards(obj.owner); + } + if (obj.withdraw) { std::map userFuturesValues;