2 sats \ 1 reply \ @eduardopro OP 23 Nov 2021 \ parent \ on: I'm four or five years into Bitcoin and a year full-time into Bitcoin. And, every three weeks or so, I find some idea or have a realization about Bitcoin that blows my mind and leaves me in awe. bitcoin
I heard somewhere that the halving is just one line of code.
And I started thinking about everything that the halving implies and does and sets in motion... and it's one line of code. Wow.
CAmount GetBlockSubsidy(int nHeight, const Consensus::Params& consensusParams) { int halvings = nHeight / consensusParams.nSubsidyHalvingInterval; // Force block reward to zero when right shift is undefined. if (halvings >= 64) return 0; CAmount nSubsidy = 50 * COIN; // Subsidy is cut in half every 210,000 blocks which will occur approximately every 4 years. nSubsidy >>= halvings; return nSubsidy; }
reply