mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Merge 9f7661c0c4 into merged_master (Bitcoin PR bitcoin/bitcoin#19499)
This commit is contained in:
commit
70c69d94f6
12 changed files with 66 additions and 58 deletions
|
|
@ -4421,9 +4421,10 @@ void PeerManagerImpl::CheckForStaleTipAndEvictPeers()
|
|||
|
||||
void PeerManagerImpl::MaybeSendPing(CNode& node_to, Peer& peer, std::chrono::microseconds now)
|
||||
{
|
||||
if (m_connman.ShouldRunInactivityChecks(node_to, std::chrono::duration_cast<std::chrono::seconds>(now).count()) &&
|
||||
if (m_connman.ShouldRunInactivityChecks(node_to, std::chrono::duration_cast<std::chrono::seconds>(now)) &&
|
||||
peer.m_ping_nonce_sent &&
|
||||
now > peer.m_ping_start.load() + std::chrono::seconds{TIMEOUT_INTERVAL}) {
|
||||
now > peer.m_ping_start.load() + TIMEOUT_INTERVAL)
|
||||
{
|
||||
// The ping timeout is using mocktime. To disable the check during
|
||||
// testing, increase -peertimeout.
|
||||
LogPrint(BCLog::NET, "ping timeout: %fs peer=%d\n", 0.000001 * count_microseconds(now - peer.m_ping_start.load()), peer.m_id);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue