aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGleb Naumenko <naumenko.gs@gmail.com>2021-09-14 15:19:41 +0300
committerstratospher <44024636+stratospher@users.noreply.github.com>2023-03-15 20:12:05 +0530
commit72e8ffd7f8dbf908e65da6d012ede914596737ab (patch)
tree50c9dd110574b0881067fd00e0eefa15fe26a0b1 /src
parent3faae99c3d8e512f9d3f6e7fb0785c60d4bed654 (diff)
p2p: Account for MANUAL conns when diversifying persistent outbound conns
Previously, we would make connections to peer from the netgroups to which our MANUAL outbound connections belong. However, they should be seen as regular connections from Addrman when it comes to netgroup diversity check, since the same rationale can be applied. Note, this has nothing to do with how we connect to MANUAL connections: we connect to them unconditionally.
Diffstat (limited to 'src')
-rw-r--r--src/net.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/net.cpp b/src/net.cpp
index e19decbda8..9b803180f9 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -1727,14 +1727,12 @@ void CConnman::ThreadOpenConnections(const std::vector<std::string> connect)
// free to make, an attacker could make them to prevent us from connecting to
// certain peers.
case ConnectionType::INBOUND:
- // Manually selected connections should not affect how we select outbound
- // peers from addrman.
- case ConnectionType::MANUAL:
// Short-lived outbound connections should not affect how we select outbound
// peers from addrman.
case ConnectionType::ADDR_FETCH:
case ConnectionType::FEELER:
break;
+ case ConnectionType::MANUAL:
case ConnectionType::OUTBOUND_FULL_RELAY:
case ConnectionType::BLOCK_RELAY:
setConnected.insert(m_netgroupman.GetGroup(pnode->addr));