diff options
author | Carl Dong <contact@carldong.me> | 2021-09-20 16:44:21 -0400 |
---|---|---|
committer | Carl Dong <contact@carldong.me> | 2021-12-06 15:56:55 -0500 |
commit | 9162a4f93ef5aeb57fe11a6e09f5881cf431f5e6 (patch) | |
tree | 1ef3829ddaadb842e7c20f921922ee336efb5141 /src/node/chainstate.cpp | |
parent | c7a5c46e6fd6d6ff46ca7a65fc3f0fff3cbdb24e (diff) |
node/chainstate: Decouple from concept of NodeContext
...instead pass in only the necessary information
Also allow mempool to be a nullptr
Diffstat (limited to 'src/node/chainstate.cpp')
-rw-r--r-- | src/node/chainstate.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
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 <rpc/blockchain.h> // for RPCNotifyBlockChange #include <util/time.h> // for GetTime #include <node/blockstorage.h> // for CleanupBlockRevFiles, fHavePruned, fReindex -#include <node/context.h> // for NodeContext #include <node/ui_interface.h> // for InitError, uiInterface, and CClientUIInterface member access #include <shutdown.h> // for ShutdownRequested #include <validation.h> // for a lot of things std::optional<ChainstateLoadingError> LoadChainstate(bool fReset, ChainstateManager& chainman, - NodeContext& node, + CTxMemPool* mempool, bool fPruneMode, const CChainParams& chainparams, bool fReindexChainState, @@ -32,11 +31,11 @@ std::optional<ChainstateLoadingError> 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 |