Skip to content

Commit

Permalink
miner.cpp add blockReward for founderPayment
Browse files Browse the repository at this point in the history
  • Loading branch information
alamshafil committed Jul 14, 2022
1 parent 119222c commit 1d7271d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/miner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,9 @@ std::unique_ptr<CBlockTemplate> BlockAssembler::CreateNewBlock(const CScript& sc
coinbaseTx.vout[0].nValue = nFees + GetBlockSubsidy(nHeight, chainparams.GetConsensus());
coinbaseTx.vin[0].scriptSig = CScript() << nHeight << OP_0;

// NOTE: unlike in bitcoin, we need to pass PREVIOUS block height here
CAmount blockReward = nFees + GetBlockSubsidy(pindexPrev->nHeight, Params().GetConsensus());

// Fill founder payment
FounderPayment founderPayment = chainparams.GetConsensus().nFounderPayment;
founderPayment.FillFounderPayment(coinbaseTx, nHeight, blockReward, pblock->txoutFounder);
Expand Down

0 comments on commit 1d7271d

Please sign in to comment.