Merge pull request #3842 from ditto-b/master
Fix for GetBlockValue() after block 13,440,000
This commit is contained in:
@@ -1176,9 +1176,14 @@ void static PruneOrphanBlocks()
|
||||
int64_t GetBlockValue(int nHeight, int64_t nFees)
|
||||
{
|
||||
int64_t nSubsidy = 50 * COIN;
|
||||
int halvings = nHeight / Params().SubsidyHalvingInterval();
|
||||
|
||||
// Force block reward to zero when right shift is undefined.
|
||||
if (halvings >= 64)
|
||||
return nFees;
|
||||
|
||||
// Subsidy is cut in half every 210,000 blocks which will occur approximately every 4 years.
|
||||
nSubsidy >>= (nHeight / Params().SubsidyHalvingInterval());
|
||||
nSubsidy >>= halvings;
|
||||
|
||||
return nSubsidy + nFees;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user