mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-16 13:01:19 +02:00
p2p: allow p2ptimeout to be configurable, speed up slow test
This commit is contained in:
parent
384967f311
commit
8042bbfbf0
4 changed files with 35 additions and 11 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue