mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
Merge bitcoin/bitcoin#23218: p2p: Use mocktime for ping timeout
fadf1186c8p2p: Use mocktime for ping timeout (MarcoFalke) Pull request description: It is slightly confusing to use mocktime for some times, but not others. Start fixing that by making the ping timeout use mocktime. The only downside would be that tests that use mocktime disconnect peers after this patch. However, I don't think this is an issue, as the inactivity check is already disabled for all functional tests after commit6d76b57ca0. Only one unit test needed the inactivity check disabled as part of this patch. A nice side effect of this patch is that the `p2p_ping` functional test now runs 4 seconds faster. ACKs for top commit: laanwj: Code review ACKfadf1186c8Tree-SHA512: e9e7b21040a89d9d574b3038f85a67e6336de6cd6e41aa286769cd03cada6e75a94ec01700e052e56d822ef85d7813cc06bf7e67b81543eff8917a16cdccf942
This commit is contained in:
@@ -942,7 +942,7 @@ public:
|
||||
std::chrono::microseconds PoissonNextSendInbound(std::chrono::microseconds now, std::chrono::seconds average_interval);
|
||||
|
||||
/** Return true if we should disconnect the peer for failing an inactivity check. */
|
||||
bool ShouldRunInactivityChecks(const CNode& node, std::optional<int64_t> now=std::nullopt) const;
|
||||
bool ShouldRunInactivityChecks(const CNode& node, int64_t secs_now) const;
|
||||
|
||||
private:
|
||||
struct ListenSocket {
|
||||
|
||||
Reference in New Issue
Block a user