From aa74200d5a93d8c5fd881a0ffbb71bb678a1b66a Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Sun, 21 Aug 2016 06:19:05 +0300 Subject: [PATCH] Fix GetPaymentsLimit() --- src/governance-classes.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/governance-classes.cpp b/src/governance-classes.cpp index 8694d84553..9c85630a40 100644 --- a/src/governance-classes.cpp +++ b/src/governance-classes.cpp @@ -525,9 +525,9 @@ CAmount CSuperblock::GetPaymentsLimit(int nBlockHeight) // min subsidy for high diff networks and vice versa int nBits = consensusParams.fPowAllowMinDifficultyBlocks ? UintToArith256(consensusParams.powLimit).GetCompact() : 1; - CAmount nBlockSubsidy = GetBlockSubsidy(nBits, nBlockHeight, consensusParams); - // 10% of all blocks issued during the cycle goes to superblock - CAmount nPaymentsLimit = nBlockSubsidy * consensusParams.nSuperblockCycle / 10; + // some part of all blocks issued during the cycle goes to superblock, see GetBlockSubsidy + CAmount nSuperblockPartOfSubsidy = GetBlockSubsidy(nBits, nBlockHeight, consensusParams, true); + CAmount nPaymentsLimit = nSuperblockPartOfSubsidy * consensusParams.nSuperblockCycle; LogPrint("gobject", "CSuperblock::GetPaymentsLimit -- Valid superblock height %d, payments max %lld\n", nBlockHeight, nPaymentsLimit); return nPaymentsLimit;