mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-01-31 09:14:56 +00:00
Be more aggressive in connecting to peers with relevant services.
Only allow skipping relevant services until there are four outbound connections up. This avoids quickly filling up with peers lacking the relevant services when addrman has few or none of them. Github-Pull: #8949 Rebased-From: 9583477288072e203541b747fcffe8d50cfefb8d
This commit is contained in:
parent
2c0913d0b3
commit
33cd5539b2
@ -1707,8 +1707,8 @@ void 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
|
// only consider nodes missing relevant services after 40 failed attempts and only if less than half the outbound are up.
|
||||||
if ((addr.nServices & nRelevantServices) != nRelevantServices && nTries < 40)
|
if ((addr.nServices & nRelevantServices) != nRelevantServices && (nTries < 40 || nOutbound >= (nMaxOutbound >> 1)))
|
||||||
continue;
|
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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user