refactor: Make CTxMemPool::m_check_ratio a const and a constructor argument

Since m_check_ratio is only set once and since the CTxMemPool object is
no longer a global variable, m_check_ratio can be passed into the
constructor of CTxMemPool. Since it is only read from after
initialization, m_check_ratio can also be made a const and hence no
longer needs to be guarded by the cs mutex.
This commit is contained in:
Elle Mouton
2020-10-20 20:42:47 +02:00
parent 9d4b4b2c2c
commit e3310692d0
4 changed files with 14 additions and 20 deletions

View File

@@ -141,8 +141,7 @@ TestingSetup::TestingSetup(const std::string& chainName, const std::vector<const
pblocktree.reset(new CBlockTreeDB(1 << 20, true));
m_node.mempool = MakeUnique<CTxMemPool>(&::feeEstimator);
m_node.mempool->setSanityCheck(1.0);
m_node.mempool = MakeUnique<CTxMemPool>(&::feeEstimator, 1);
m_node.chainman = &::g_chainman;
m_node.chainman->InitializeChainstate(*m_node.mempool);