diff options
author | MarcoFalke <falke.marco@gmail.com> | 2020-07-28 07:40:49 +0200 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2020-08-28 10:42:04 +0200 |
commit | fa0572d0f3b083b4c8e2e883a66e2b198c6779f1 (patch) | |
tree | 7a2e75b21eb48418728fb704ec2e620eb194f671 /src/test/util | |
parent | 862fde88be706adb20a211178253636442c3ae00 (diff) | |
download | bitcoin-fa0572d0f3b083b4c8e2e883a66e2b198c6779f1.tar.xz |
Pass mempool reference to chainstate constructor
Diffstat (limited to 'src/test/util')
-rw-r--r-- | src/test/util/setup_common.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/test/util/setup_common.cpp b/src/test/util/setup_common.cpp index d9a00c2205..8a88e75892 100644 --- a/src/test/util/setup_common.cpp +++ b/src/test/util/setup_common.cpp @@ -141,8 +141,11 @@ TestingSetup::TestingSetup(const std::string& chainName, const std::vector<const pblocktree.reset(new CBlockTreeDB(1 << 20, true)); + m_node.mempool = &::mempool; + m_node.mempool->setSanityCheck(1.0); + m_node.chainman = &::g_chainman; - m_node.chainman->InitializeChainstate(); + m_node.chainman->InitializeChainstate(*m_node.mempool); ::ChainstateActive().InitCoinsDB( /* cache_size_bytes */ 1 << 23, /* in_memory */ true, /* should_wipe */ false); assert(!::ChainstateActive().CanFlushToDisk()); @@ -164,8 +167,6 @@ TestingSetup::TestingSetup(const std::string& chainName, const std::vector<const } g_parallel_script_checks = true; - m_node.mempool = &::mempool; - m_node.mempool->setSanityCheck(1.0); m_node.banman = MakeUnique<BanMan>(GetDataDir() / "banlist.dat", nullptr, DEFAULT_MISBEHAVING_BANTIME); m_node.connman = MakeUnique<CConnman>(0x1337, 0x1337); // Deterministic randomness for tests. m_node.peer_logic = MakeUnique<PeerLogicValidation>(*m_node.connman, m_node.banman.get(), *m_node.scheduler, *m_node.chainman, *m_node.mempool); |