p2p: Use mocktime for ping timeout

This commit is contained in:
MarcoFalke
2021-10-07 13:22:51 +02:00
parent c0b6c96eee
commit fadf1186c8
6 changed files with 25 additions and 7 deletions

View File

@@ -1295,9 +1295,8 @@ void CConnman::NotifyNumConnectionsChanged()
}
}
bool CConnman::ShouldRunInactivityChecks(const CNode& node, std::optional<int64_t> now_in) const
bool CConnman::ShouldRunInactivityChecks(const CNode& node, int64_t now) const
{
const int64_t now = now_in ? now_in.value() : GetTimeSeconds();
return node.nTimeConnected + m_peer_connect_timeout < now;
}