- Blockchain By Example
- Bellaj Badr Richard Horrocks Xun (Brian) Wu
- 128字
- 2021-06-10 18:53:43
Rewarding
At this level, we are finally going to change the monetary variables of our new cryptocurrency, such as issuance rate and the total amount of Readercoins circulating. As you might know, the Bitcoin protocol rewards miners by giving them freshly minted coins for doing their jobs. The reward is 50 new coins, which decreases constantly with time.
In src/validation.cpp, you'll find a parameter called nSubsidy in the GetBlockSubsidy function, which defines the initial value of the reward. We will be less generous. We will set this value to 10 as follows:
CAmount nSubsidy = 10 * COIN;
Remember, we set the same reward value when we generated our genesis block in the CreateGenesisBlock function in chainparams.cpp to be consistent with the defined reward per block.