diff --git a/src/init.cpp b/src/init.cpp index f44373728d..eb23ae501c 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1421,7 +1421,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info) const int64_t load_block_index_start_time = GetTimeMillis(); auto rv = LoadChainstate(fReset, chainman, - node, + node.mempool.get(), fPruneMode, chainparams, fReindexChainState, diff --git a/src/node/chainstate.cpp b/src/node/chainstate.cpp index 3d02c52edb..4b0b71e00f 100644 --- a/src/node/chainstate.cpp +++ b/src/node/chainstate.cpp @@ -8,14 +8,13 @@ #include // for RPCNotifyBlockChange #include // for GetTime #include // for CleanupBlockRevFiles, fHavePruned, fReindex -#include // for NodeContext #include // for InitError, uiInterface, and CClientUIInterface member access #include // for ShutdownRequested #include // for a lot of things std::optional LoadChainstate(bool fReset, ChainstateManager& chainman, - NodeContext& node, + CTxMemPool* mempool, bool fPruneMode, const CChainParams& chainparams, bool fReindexChainState, @@ -32,11 +31,11 @@ std::optional LoadChainstate(bool fReset, do { try { LOCK(cs_main); - chainman.InitializeChainstate(Assert(node.mempool.get())); + chainman.InitializeChainstate(Assert(mempool)); chainman.m_total_coinstip_cache = nCoinCacheUsage; chainman.m_total_coinsdb_cache = nCoinDBCache; - UnloadBlockIndex(node.mempool.get(), chainman); + UnloadBlockIndex(mempool, chainman); auto& pblocktree{chainman.m_blockman.m_block_tree_db}; // new CBlockTreeDB tries to delete the existing file, which diff --git a/src/node/chainstate.h b/src/node/chainstate.h index 87aad23e27..39621a31c5 100644 --- a/src/node/chainstate.h +++ b/src/node/chainstate.h @@ -10,7 +10,7 @@ class CChainParams; class ChainstateManager; -struct NodeContext; +class CTxMemPool; enum class ChainstateLoadingError { ERROR_LOADING_BLOCK_DB, @@ -55,7 +55,7 @@ enum class ChainstateLoadingError { */ std::optional LoadChainstate(bool fReset, ChainstateManager& chainman, - NodeContext& node, + CTxMemPool* mempool, bool fPruneMode, const CChainParams& chainparams, bool fReindexChainState,