mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-13 07:28:59 +01:00
p2p: Use mocktime for ping timeout
This commit is contained in:
@@ -52,6 +52,8 @@ BOOST_AUTO_TEST_CASE(outbound_slow_chain_eviction)
|
||||
{
|
||||
const CChainParams& chainparams = Params();
|
||||
auto connman = std::make_unique<CConnman>(0x1337, 0x1337, *m_node.addrman);
|
||||
// Disable inactivity checks for this test to avoid interference
|
||||
static_cast<ConnmanTestMsg*>(connman.get())->SetPeerConnectTimeout(99999);
|
||||
auto peerLogic = PeerManager::make(chainparams, *connman, *m_node.addrman, nullptr,
|
||||
*m_node.chainman, *m_node.mempool, false);
|
||||
|
||||
|
||||
@@ -17,6 +17,12 @@
|
||||
|
||||
struct ConnmanTestMsg : public CConnman {
|
||||
using CConnman::CConnman;
|
||||
|
||||
void SetPeerConnectTimeout(int64_t timeout)
|
||||
{
|
||||
m_peer_connect_timeout = timeout;
|
||||
}
|
||||
|
||||
void AddTestNode(CNode& node)
|
||||
{
|
||||
LOCK(cs_vNodes);
|
||||
|
||||
Reference in New Issue
Block a user