aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/net.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/net.cpp b/src/net.cpp
index 87f1ef0577..3f87dc6357 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -1765,9 +1765,15 @@ void CConnman::ThreadOpenConnections(const std::vector<std::string> connect)
addr = addrman.Select(fFeeler);
}
+ // Require outbound connections to be to distinct network groups
+ if (!fFeeler && setConnected.count(addr.GetGroup())) {
+ break;
+ }
+
// if we selected an invalid address, restart
- if (!addr.IsValid() || setConnected.count(addr.GetGroup()) || IsLocal(addr))
+ if (!addr.IsValid() || IsLocal(addr)) {
break;
+ }
// If we didn't find an appropriate destination after trying 100 addresses fetched from addrman,
// stop this loop, and let the outer loop run again (which sleeps, adds seed nodes, recalculates