Commit 445bd7d5 authored by ditto-b's avatar ditto-b
Browse files

Fix for GetBlockValue() after block 13,440,000

Forces the block reward to zero when right shift in GetBlockValue() is
undefined, after 64 reward halvings (block height 13,440,000).
parent 101b3e6d
Showing with 6 additions and 1 deletion
+6 -1
......@@ -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;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment