From 935bd0a447834fa48c218ddae2a5d835a67979ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Tim=C3=B3n?= Date: Wed, 1 Apr 2015 16:03:11 +0200 Subject: Chainparams: Refactor: Decouple main::GetBlockValue() from Params() [renamed GetBlockSubsidy] Remove redundant getter CChainParams::SubsidyHalvingInterval() --- src/miner.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/miner.cpp') diff --git a/src/miner.cpp b/src/miner.cpp index 4bceb7d7b..804a68852 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -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 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; -- cgit v1.2.3