Changeset View
Changeset View
Standalone View
Standalone View
src/test/util/setup_common.cpp
Show First 20 Lines • Show All 199 Lines • ▼ Show 20 Lines | TestingSetup::TestingSetup(const std::string &chainName, | ||||
m_node.mempool = &::g_mempool; | m_node.mempool = &::g_mempool; | ||||
m_node.mempool->setSanityCheck(1.0); | m_node.mempool->setSanityCheck(1.0); | ||||
m_node.banman = | m_node.banman = | ||||
std::make_unique<BanMan>(GetDataDir() / "banlist.dat", chainparams, | std::make_unique<BanMan>(GetDataDir() / "banlist.dat", chainparams, | ||||
nullptr, DEFAULT_MISBEHAVING_BANTIME); | nullptr, DEFAULT_MISBEHAVING_BANTIME); | ||||
// Deterministic randomness for tests. | // Deterministic randomness for tests. | ||||
m_node.connman = std::make_unique<CConnman>(config, 0x1337, 0x1337); | m_node.connman = std::make_unique<CConnman>(config, 0x1337, 0x1337); | ||||
m_node.peer_logic = std::make_unique<PeerLogicValidation>( | m_node.peer_logic = std::make_unique<PeerLogicValidation>( | ||||
*m_node.connman, m_node.banman.get(), *m_node.scheduler, | chainparams, *m_node.connman, m_node.banman.get(), *m_node.scheduler, | ||||
*m_node.chainman, *m_node.mempool); | *m_node.chainman, *m_node.mempool); | ||||
{ | { | ||||
CConnman::Options options; | CConnman::Options options; | ||||
options.m_msgproc = m_node.peer_logic.get(); | options.m_msgproc = m_node.peer_logic.get(); | ||||
m_node.connman->Init(options); | m_node.connman->Init(options); | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 194 Lines • Show Last 20 Lines |