refactor: Remove mempool global from net

This refactor does two things:
* Pass mempool in to PeerLogicValidation
* Pass m_mempool around where needed
This commit is contained in:
MarcoFalke
2020-01-24 14:00:57 -05:00
parent 309b0c4c19
commit fa7fea3654
6 changed files with 49 additions and 44 deletions

View File

@@ -137,7 +137,7 @@ TestingSetup::TestingSetup(const std::string& chainName) : BasicTestingSetup(cha
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.get(), m_node.banman.get(), *m_node.scheduler);
m_node.peer_logic = MakeUnique<PeerLogicValidation>(m_node.connman.get(), m_node.banman.get(), *m_node.scheduler, *m_node.mempool);
}
TestingSetup::~TestingSetup()