From 9dc0dbbac38a78d0305ded55b384d9ea222faa9a Mon Sep 17 00:00:00 2001 From: HashEngineering Date: Wed, 25 Oct 2023 18:42:05 -0700 Subject: [PATCH] fix: change calculation for masternode rewards after v20 activation --- .../wallet/service/BlockchainStateDataProvider.kt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/wallet/src/de/schildbach/wallet/service/BlockchainStateDataProvider.kt b/wallet/src/de/schildbach/wallet/service/BlockchainStateDataProvider.kt index 4d45daf1c1..289bb0bc32 100644 --- a/wallet/src/de/schildbach/wallet/service/BlockchainStateDataProvider.kt +++ b/wallet/src/de/schildbach/wallet/service/BlockchainStateDataProvider.kt @@ -206,6 +206,14 @@ class BlockchainStateDataProvider @Inject constructor( // Activated but we have to wait for the next cycle to start realocation, nothing to do return ret } + + if (Constants.NETWORK_PARAMETERS.isV20Active(height)) { + // Once MNRewardReallocated activates, block reward is 80% of block subsidy (+ tx fees) since treasury is 20% + // Since the MN reward needs to be equal to 60% of the block subsidy (according to the proposal), MN reward is set to 75% of the block reward. + // Previous reallocation periods are dropped. + return blockValue * 3 / 4 + } + val reallocCycle = superblockCycle * 3 val nCurrentPeriod: Int = min((height - reallocStart) / reallocCycle, periods.size - 1)