pull down to refresh
Just trying out to write the program code for the next Bitcoin Halving (fourth halving in 2024) that is using C programming language.
I don't get what you are trying to do. But looking at your hints, I would guess you are trying to explain how the function works?
reply
Of course, that's a function of block subsidy and reward halving
reply
Just trying out to write the program code for the next Bitcoin Halving (fourth halving in 2024) that is using C programming language.
Making the use of The GetBlockSubsidy() function;
CAmount GetBlockSubsidy(int nHeight, const Concensus::Params& consensusParams) { int halvings = nHeight / consensusParams.nSubsidyHalvingInterval; // Force block reward to zero when right shiftis undefined. if (halvings >= 64) return 0; cAmount nSubsidy = 50 * COIN; //Subsidy is cut in half every after 210, 000 blocks which will occur approximately every four years nSubsidy >>= halvings; return nSubsidy }
Hints:
Any constructive additions or subtractions are welcome!