p2p: Use the greatest common version in peer logic

This commit is contained in:
Hennadii Stepanov
2020-08-25 01:58:15 +03:00
parent e084d45562
commit ddefb5c0b7
2 changed files with 10 additions and 11 deletions

View File

@@ -1167,7 +1167,7 @@ void CConnman::InactivityCheck(CNode *pnode)
LogPrintf("socket sending timeout: %is\n", nTime - pnode->nLastSend);
pnode->fDisconnect = true;
}
else if (nTime - pnode->nLastRecv > (pnode->nVersion > BIP0031_VERSION ? TIMEOUT_INTERVAL : 90*60))
else if (nTime - pnode->nLastRecv > (pnode->GetCommonVersion() > BIP0031_VERSION ? TIMEOUT_INTERVAL : 90*60))
{
LogPrintf("socket receive timeout: %is\n", nTime - pnode->nLastRecv);
pnode->fDisconnect = true;