mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
p2p: allow p2ptimeout to be configurable, speed up slow test
This commit is contained in:
committed by
Zain Iqbal Allarakhia
parent
384967f311
commit
8042bbfbf0
@@ -1232,11 +1232,11 @@ void CConnman::NotifyNumConnectionsChanged()
|
||||
void CConnman::InactivityCheck(CNode *pnode)
|
||||
{
|
||||
int64_t nTime = GetSystemTimeInSeconds();
|
||||
if (nTime - pnode->nTimeConnected > 60)
|
||||
if (nTime - pnode->nTimeConnected > m_peer_connect_timeout)
|
||||
{
|
||||
if (pnode->nLastRecv == 0 || pnode->nLastSend == 0)
|
||||
{
|
||||
LogPrint(BCLog::NET, "socket no message in first 60 seconds, %d %d from %d\n", pnode->nLastRecv != 0, pnode->nLastSend != 0, pnode->GetId());
|
||||
LogPrint(BCLog::NET, "socket no message in first %i seconds, %d %d from %d\n", m_peer_connect_timeout, pnode->nLastRecv != 0, pnode->nLastSend != 0, pnode->GetId());
|
||||
pnode->fDisconnect = true;
|
||||
}
|
||||
else if (nTime - pnode->nLastSend > TIMEOUT_INTERVAL)
|
||||
|
||||
Reference in New Issue
Block a user