diff options
Diffstat (limited to 'src/net.cpp')
-rw-r--r-- | src/net.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/net.cpp b/src/net.cpp index 201914685c..e08ce0fd33 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -1824,11 +1824,18 @@ void CConnman::ThreadOpenConnections(const std::vector<std::string> connect) } } + addrman.ResolveCollisions(); + int64_t nANow = GetAdjustedTime(); int nTries = 0; while (!interruptNet) { - CAddrInfo addr = addrman.Select(fFeeler); + CAddrInfo addr = addrman.SelectTriedCollision(); + + // SelectTriedCollision returns an invalid address if it is empty. + if (!fFeeler || !addr.IsValid()) { + addr = addrman.Select(fFeeler); + } // if we selected an invalid address, restart if (!addr.IsValid() || setConnected.count(addr.GetGroup()) || IsLocal(addr)) |