mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 15:09:59 +01:00
use ChainstateManager to initialize chainstate
This allows us to easily initialize multiple chainstates on startup in future commits. It retires the g_chainstate global in lieu of g_chainman.
This commit is contained in:
committed by
James O'Beirne
parent
5b690f0aae
commit
4ae29f5f0c
@@ -111,7 +111,7 @@ TestingSetup::TestingSetup(const std::string& chainName) : BasicTestingSetup(cha
|
||||
GetMainSignals().RegisterBackgroundSignalScheduler(*g_rpc_node->scheduler);
|
||||
|
||||
pblocktree.reset(new CBlockTreeDB(1 << 20, true));
|
||||
g_chainstate = MakeUnique<CChainState>();
|
||||
g_chainman.InitializeChainstate();
|
||||
::ChainstateActive().InitCoinsDB(
|
||||
/* cache_size_bytes */ 1 << 23, /* in_memory */ true, /* should_wipe */ false);
|
||||
assert(!::ChainstateActive().CanFlushToDisk());
|
||||
@@ -153,7 +153,7 @@ TestingSetup::~TestingSetup()
|
||||
m_node.mempool = nullptr;
|
||||
m_node.scheduler.reset();
|
||||
UnloadBlockIndex();
|
||||
g_chainstate.reset();
|
||||
g_chainman.Reset();
|
||||
pblocktree.reset();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user