aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Towns <aj@erisian.com.au>2022-04-15 05:41:19 +1000
committerAnthony Towns <aj@erisian.com.au>2022-05-10 12:09:33 +1000
commit5c67e84d37d452e9186a6357e5405fabeff241c7 (patch)
tree34091e8ac118882329768704e8e3095eb209c44a
parent38860f93b680f152fc6fc3d9ae574a4c0659e775 (diff)
downloadbitcoin-5c67e84d37d452e9186a6357e5405fabeff241c7.tar.xz
validation: replace ::Params() calls with chainstate/chainman member
-rw-r--r--src/validation.cpp8
-rw-r--r--src/validation.h1
2 files changed, 5 insertions, 4 deletions
diff --git a/src/validation.cpp b/src/validation.cpp
index fb05b9c18e..e462ff61eb 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -1457,7 +1457,7 @@ PackageMempoolAcceptResult ProcessNewPackage(CChainState& active_chainstate, CTx
assert(std::all_of(package.cbegin(), package.cend(), [](const auto& tx){return tx != nullptr;}));
std::vector<COutPoint> coins_to_uncache;
- const CChainParams& chainparams = Params();
+ const CChainParams& chainparams = active_chainstate.m_params;
const auto result = [&]() EXCLUSIVE_LOCKS_REQUIRED(cs_main) {
AssertLockHeld(cs_main);
if (test_accept) {
@@ -1515,7 +1515,7 @@ CChainState::CChainState(
std::optional<uint256> from_snapshot_blockhash)
: m_mempool(mempool),
m_blockman(blockman),
- m_params(::Params()),
+ m_params(chainman.GetParams()),
m_chainman(chainman),
m_from_snapshot_blockhash(from_snapshot_blockhash) {}
@@ -4993,7 +4993,7 @@ bool ChainstateManager::PopulateAndValidateSnapshot(
}
int base_height = snapshot_start_block->nHeight;
- auto maybe_au_data = ExpectedAssumeutxo(base_height, ::Params());
+ auto maybe_au_data = ExpectedAssumeutxo(base_height, GetParams());
if (!maybe_au_data) {
LogPrintf("[snapshot] assumeutxo height in snapshot metadata not recognized " /* Continued */
@@ -5147,7 +5147,7 @@ bool ChainstateManager::PopulateAndValidateSnapshot(
// Fake BLOCK_OPT_WITNESS so that CChainState::NeedsRedownload()
// won't ask to rewind the entire assumed-valid chain on startup.
- if (DeploymentActiveAt(*index, ::Params().GetConsensus(), Consensus::DEPLOYMENT_SEGWIT)) {
+ if (DeploymentActiveAt(*index, GetConsensus(), Consensus::DEPLOYMENT_SEGWIT)) {
index->nStatus |= BLOCK_OPT_WITNESS;
}
diff --git a/src/validation.h b/src/validation.h
index d23f0a3716..1c30bcb57d 100644
--- a/src/validation.h
+++ b/src/validation.h
@@ -498,6 +498,7 @@ public:
node::BlockManager& m_blockman;
/** Chain parameters for this chainstate */
+ /* TODO: replace with m_chainman.GetParams() */
const CChainParams& m_params;
//! The chainstate manager that owns this chainstate. The reference is