Skip to content

Commit 5c67e84

Browse files
committed
validation: replace ::Params() calls with chainstate/chainman member
1 parent 38860f9 commit 5c67e84

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/validation.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1457,7 +1457,7 @@ PackageMempoolAcceptResult ProcessNewPackage(CChainState& active_chainstate, CTx
14571457
assert(std::all_of(package.cbegin(), package.cend(), [](const auto& tx){return tx != nullptr;}));
14581458

14591459
std::vector<COutPoint> coins_to_uncache;
1460-
const CChainParams& chainparams = Params();
1460+
const CChainParams& chainparams = active_chainstate.m_params;
14611461
const auto result = [&]() EXCLUSIVE_LOCKS_REQUIRED(cs_main) {
14621462
AssertLockHeld(cs_main);
14631463
if (test_accept) {
@@ -1515,7 +1515,7 @@ CChainState::CChainState(
15151515
std::optional<uint256> from_snapshot_blockhash)
15161516
: m_mempool(mempool),
15171517
m_blockman(blockman),
1518-
m_params(::Params()),
1518+
m_params(chainman.GetParams()),
15191519
m_chainman(chainman),
15201520
m_from_snapshot_blockhash(from_snapshot_blockhash) {}
15211521

@@ -4993,7 +4993,7 @@ bool ChainstateManager::PopulateAndValidateSnapshot(
49934993
}
49944994

49954995
int base_height = snapshot_start_block->nHeight;
4996-
auto maybe_au_data = ExpectedAssumeutxo(base_height, ::Params());
4996+
auto maybe_au_data = ExpectedAssumeutxo(base_height, GetParams());
49974997

49984998
if (!maybe_au_data) {
49994999
LogPrintf("[snapshot] assumeutxo height in snapshot metadata not recognized " /* Continued */
@@ -5147,7 +5147,7 @@ bool ChainstateManager::PopulateAndValidateSnapshot(
51475147

51485148
// Fake BLOCK_OPT_WITNESS so that CChainState::NeedsRedownload()
51495149
// won't ask to rewind the entire assumed-valid chain on startup.
5150-
if (DeploymentActiveAt(*index, ::Params().GetConsensus(), Consensus::DEPLOYMENT_SEGWIT)) {
5150+
if (DeploymentActiveAt(*index, GetConsensus(), Consensus::DEPLOYMENT_SEGWIT)) {
51515151
index->nStatus |= BLOCK_OPT_WITNESS;
51525152
}
51535153

src/validation.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,7 @@ class CChainState
498498
node::BlockManager& m_blockman;
499499

500500
/** Chain parameters for this chainstate */
501+
/* TODO: replace with m_chainman.GetParams() */
501502
const CChainParams& m_params;
502503

503504
//! The chainstate manager that owns this chainstate. The reference is

0 commit comments

Comments
 (0)