mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 06:28:31 +01:00
Chainparams: Refactor: Decouple main::GetBlockValue() from Params() [renamed GetBlockSubsidy]
Remove redundant getter CChainParams::SubsidyHalvingInterval()
This commit is contained in:
@@ -91,6 +91,7 @@ void UpdateTime(CBlockHeader* pblock, const Consensus::Params& consensusParams,
|
||||
|
||||
CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn)
|
||||
{
|
||||
const CChainParams& chainparams = Params();
|
||||
// Create new block
|
||||
auto_ptr<CBlockTemplate> pblocktemplate(new CBlockTemplate());
|
||||
if(!pblocktemplate.get())
|
||||
@@ -320,7 +321,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn)
|
||||
LogPrintf("CreateNewBlock(): total size %u\n", nBlockSize);
|
||||
|
||||
// Compute final coinbase transaction.
|
||||
txNew.vout[0].nValue = GetBlockValue(nHeight, nFees);
|
||||
txNew.vout[0].nValue = nFees + GetBlockSubsidy(nHeight, chainparams.GetConsensus());
|
||||
txNew.vin[0].scriptSig = CScript() << nHeight << OP_0;
|
||||
pblock->vtx[0] = txNew;
|
||||
pblocktemplate->vTxFees[0] = -nFees;
|
||||
|
||||
Reference in New Issue
Block a user