aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorW. J. van der Laan <laanwj@protonmail.com>2021-10-21 19:34:55 +0200
committerW. J. van der Laan <laanwj@protonmail.com>2021-10-21 19:44:38 +0200
commit8a083bc5b57ff98f2e3c550f1b10dba202e3aa79 (patch)
tree69ffb5d97b56b33827def543ea99d236190beec9 /src/net.h
parentf41aa81c996f55f26f4ec33b4803e4a10d1299bf (diff)
parentfadf1186c899f45787a91c28120b0608bdc6c246 (diff)
downloadbitcoin-8a083bc5b57ff98f2e3c550f1b10dba202e3aa79.tar.xz
Merge bitcoin/bitcoin#23218: p2p: Use mocktime for ping timeout
fadf1186c899f45787a91c28120b0608bdc6c246 p2p: 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 commit 6d76b57ca0cdf6f9c19ce065b9a4a628930a78b5. 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 ACK fadf1186c899f45787a91c28120b0608bdc6c246 Tree-SHA512: e9e7b21040a89d9d574b3038f85a67e6336de6cd6e41aa286769cd03cada6e75a94ec01700e052e56d822ef85d7813cc06bf7e67b81543eff8917a16cdccf942
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/net.h b/src/net.h
index 3f0d4decae..48dfb3043f 100644
--- a/src/net.h
+++ b/src/net.h
@@ -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 {