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/validation.cpp | |
parent | 5c67e84d37d452e9186a6357e5405fabeff241c7 (diff) | |
download | bitcoin-eaa2e3f25cefbd1b9a1214102f88dbfa8109d244.tar.xz |
validation: move UpdateUncommittedBlockStructures and GenerateCoinbaseCommitment into ChainstateManager
Diffstat (limited to 'src/validation.cpp')
-rw-r--r-- | src/validation.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/validation.cpp b/src/validation.cpp index e462ff61eb..3fb1f16366 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -3398,11 +3398,11 @@ bool CheckBlock(const CBlock& block, BlockValidationState& state, const Consensu return true; } -void UpdateUncommittedBlockStructures(CBlock& block, const CBlockIndex* pindexPrev, const Consensus::Params& consensusParams) +void ChainstateManager::UpdateUncommittedBlockStructures(CBlock& block, const CBlockIndex* pindexPrev) const { int commitpos = GetWitnessCommitmentIndex(block); static const std::vector<unsigned char> nonce(32, 0x00); - if (commitpos != NO_WITNESS_COMMITMENT && DeploymentActiveAfter(pindexPrev, consensusParams, Consensus::DEPLOYMENT_SEGWIT) && !block.vtx[0]->HasWitness()) { + if (commitpos != NO_WITNESS_COMMITMENT && DeploymentActiveAfter(pindexPrev, GetConsensus(), Consensus::DEPLOYMENT_SEGWIT) && !block.vtx[0]->HasWitness()) { CMutableTransaction tx(*block.vtx[0]); tx.vin[0].scriptWitness.stack.resize(1); tx.vin[0].scriptWitness.stack[0] = nonce; @@ -3410,7 +3410,7 @@ void UpdateUncommittedBlockStructures(CBlock& block, const CBlockIndex* pindexPr } } -std::vector<unsigned char> GenerateCoinbaseCommitment(CBlock& block, const CBlockIndex* pindexPrev, const Consensus::Params& consensusParams) +std::vector<unsigned char> ChainstateManager::GenerateCoinbaseCommitment(CBlock& block, const CBlockIndex* pindexPrev) const { std::vector<unsigned char> commitment; int commitpos = GetWitnessCommitmentIndex(block); @@ -3433,7 +3433,7 @@ std::vector<unsigned char> GenerateCoinbaseCommitment(CBlock& block, const CBloc tx.vout.push_back(out); block.vtx[0] = MakeTransactionRef(std::move(tx)); } - UpdateUncommittedBlockStructures(block, pindexPrev, consensusParams); + UpdateUncommittedBlockStructures(block, pindexPrev); return commitment; } |