validation: Farewell, global Chainstate!

This commit is contained in:
Carl Dong
2020-10-06 17:35:11 -04:00
parent 972c5166ee
commit 6f994882de
7 changed files with 8 additions and 35 deletions

View File

@@ -145,7 +145,7 @@ ChainTestingSetup::ChainTestingSetup(const std::string& chainName, const std::ve
m_node.fee_estimator = std::make_unique<CBlockPolicyEstimator>();
m_node.mempool = std::make_unique<CTxMemPool>(m_node.fee_estimator.get(), 1);
m_node.chainman = &::g_chainman;
m_node.chainman = std::make_unique<ChainstateManager>();
// Start script-checking threads. Set g_parallel_script_checks to true so they are used.
constexpr int script_check_threads = 2;
@@ -167,7 +167,7 @@ ChainTestingSetup::~ChainTestingSetup()
m_node.mempool.reset();
m_node.scheduler.reset();
m_node.chainman->Reset();
m_node.chainman = nullptr;
m_node.chainman.reset();
pblocktree.reset();
}