diff options
author | Anthony Towns <aj@erisian.com.au> | 2022-01-19 04:10:26 +1000 |
---|---|---|
committer | Anthony Towns <aj@erisian.com.au> | 2022-05-10 12:09:33 +1000 |
commit | eaa2e3f25cefbd1b9a1214102f88dbfa8109d244 (patch) | |
tree | db2dbb9f0656a95ced4b7a37c6456b510f4184df /src/node/miner.cpp | |
parent | 5c67e84d37d452e9186a6357e5405fabeff241c7 (diff) | |
download | bitcoin-eaa2e3f25cefbd1b9a1214102f88dbfa8109d244.tar.xz |
validation: move UpdateUncommittedBlockStructures and GenerateCoinbaseCommitment into ChainstateManager
Diffstat (limited to 'src/node/miner.cpp')
-rw-r--r-- | src/node/miner.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/node/miner.cpp b/src/node/miner.cpp index be5d58527b..e76967edd6 100644 --- a/src/node/miner.cpp +++ b/src/node/miner.cpp @@ -51,7 +51,7 @@ void RegenerateCommitments(CBlock& block, ChainstateManager& chainman) block.vtx.at(0) = MakeTransactionRef(tx); const CBlockIndex* prev_block = WITH_LOCK(::cs_main, return chainman.m_blockman.LookupBlockIndex(block.hashPrevBlock)); - GenerateCoinbaseCommitment(block, prev_block, Params().GetConsensus()); + chainman.GenerateCoinbaseCommitment(block, prev_block); block.hashMerkleRoot = BlockMerkleRoot(block); } @@ -154,7 +154,7 @@ 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; pblock->vtx[0] = MakeTransactionRef(std::move(coinbaseTx)); - pblocktemplate->vchCoinbaseCommitment = GenerateCoinbaseCommitment(*pblock, pindexPrev, chainparams.GetConsensus()); + pblocktemplate->vchCoinbaseCommitment = m_chainstate.m_chainman.GenerateCoinbaseCommitment(*pblock, pindexPrev); pblocktemplate->vTxFees[0] = -nFees; LogPrintf("CreateNewBlock(): block weight: %u txs: %u fees: %ld sigops %d\n", GetBlockWeight(*pblock), nBlockTx, nFees, nBlockSigOpsCost); |