Only consider nodes missing relevant services after 40 failed attemps

Missed this change in previous backports as it was burried in SegWit commits.
This commit is contained in:
Alexander Block 2018-01-25 18:16:40 +01:00
parent c45c767f8e
commit 67196dc812

View File

@ -1795,6 +1795,10 @@ void CConnman::ThreadOpenConnections()
if (nANow - addr.nLastTry < 600 && nTries < 30) if (nANow - addr.nLastTry < 600 && nTries < 30)
continue; continue;
// only consider nodes missing relevant services after 40 failed attempts
if ((addr.nServices & nRelevantServices) != nRelevantServices && nTries < 40)
continue;
// do not allow non-default ports, unless after 50 invalid addresses selected already // do not allow non-default ports, unless after 50 invalid addresses selected already
if (addr.GetPort() != Params().GetDefaultPort() && nTries < 50) if (addr.GetPort() != Params().GetDefaultPort() && nTries < 50)
continue; continue;