Add founders reward to ChainParams.
Fix bug where subsidy slow shift was ignored.
This commit is contained in:
@@ -335,17 +335,14 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn)
|
||||
txNew.vout[0].scriptPubKey = scriptPubKeyIn;
|
||||
txNew.vout[0].nValue = GetBlockSubsidy(nHeight, chainparams.GetConsensus());
|
||||
|
||||
if ((nHeight > 0) && (nHeight < chainparams.GetConsensus().nSubsidyHalvingInterval)) {
|
||||
if ((nHeight > 0) && (nHeight < chainparams.GetConsensus().GetLastFoundersRewardBlockHeight())) {
|
||||
// Founders reward is 20% of the block subsidy
|
||||
auto vFoundersReward = txNew.vout[0].nValue / 5;
|
||||
// Take some reward away from us
|
||||
txNew.vout[0].nValue -= vFoundersReward;
|
||||
|
||||
auto rewardScript = ParseHex(FOUNDERS_REWARD_SCRIPT);
|
||||
|
||||
// And give it to the founders
|
||||
txNew.vout.push_back(CTxOut(vFoundersReward, CScript(rewardScript.begin(),
|
||||
rewardScript.end())));
|
||||
txNew.vout.push_back(CTxOut(vFoundersReward, chainparams.GetFoundersRewardScript(nHeight)));
|
||||
}
|
||||
|
||||
// Add fees
|
||||
|
||||
Reference in New Issue
Block a user