Merge bitcoin/bitcoin#27863: net: do not break when addr is not from a distinct network group

5fa4055452 net: do not `break` when `addr` is not from a distinct network group (brunoerg)

Pull request description:

  When the address is from a network group we already caught,
  do a `continue` and try to find another address until conditions
  are met or we reach the limit (`nTries`).

ACKs for top commit:
  amitiuttarwar:
    utACK 5fa4055452
  achow101:
    ACK 5fa4055452
  mzumsande:
    utACK 5fa4055452

Tree-SHA512: 225bb6df450b46960db934983c583e862d1a17bacfc46d3657a0eb25a0204e106e8cd18de36764e210e0a92489ab4b5773437e4a641c9b455bde74ff8a041787
This commit is contained in:
Andrew Chow 2023-06-29 19:35:36 -04:00
commit 54ba330f79
No known key found for this signature in database
GPG Key ID: 17565732E08E5E41

View File

@ -1844,7 +1844,7 @@ void CConnman::ThreadOpenConnections(const std::vector<std::string> connect)
// Require outbound IPv4/IPv6 connections, other than feelers, to be to distinct network groups
if (!fFeeler && outbound_ipv46_peer_netgroups.count(m_netgroupman.GetGroup(addr))) {
break;
continue;
}
// if we selected an invalid or local address, restart