Post
Topic
Board Bitcoin Discussion
Re: Bitcoin DOES NOT have a Cap of 21 Million Coins!!
by
aplistir
on 10/10/2019, 13:52:58 UTC


Fixing this bug correctly would require a hard fork which is not happening anytime soon!

Code:
int64_t nSubsidy = 50 * COIN;
    // Subsidy is cut in half every 210,000 blocks
    // which will occur approximately every 4 years.
    nSubsidy >>= (nHeight / 210000);

The block number is divided by 210000 (the "apparent" subsidy halving interval in blocks), and the result is used as input for a binary shift, applied to the original payout (50 BTC), expressed in base units.
Interesting find  Grin

The "right" way to fix that would be to just add a check. Eg.  If nsubsidy < "than some value", then nSubsidy == 0
With this kind of a check the binary shift would not happen when it is not needed any longer.

Why would this need a hard fork? Couldn't it just be fixed in the next versions of core? After all it is just a bug, and repairing it wouldn't conflict with any other core implementation atleast in the next 250 years or so. Smiley