Skip to content

Commit 72e8ffd

Browse files
naumenkogsstratospher
authored andcommitted
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.
1 parent 3faae99 commit 72e8ffd

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/net.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1727,14 +1727,12 @@ void CConnman::ThreadOpenConnections(const std::vector<std::string> connect)
17271727
// free to make, an attacker could make them to prevent us from connecting to
17281728
// certain peers.
17291729
case ConnectionType::INBOUND:
1730-
// Manually selected connections should not affect how we select outbound
1731-
// peers from addrman.
1732-
case ConnectionType::MANUAL:
17331730
// Short-lived outbound connections should not affect how we select outbound
17341731
// peers from addrman.
17351732
case ConnectionType::ADDR_FETCH:
17361733
case ConnectionType::FEELER:
17371734
break;
1735+
case ConnectionType::MANUAL:
17381736
case ConnectionType::OUTBOUND_FULL_RELAY:
17391737
case ConnectionType::BLOCK_RELAY:
17401738
setConnected.insert(m_netgroupman.GetGroup(pnode->addr));

0 commit comments

Comments
 (0)