The current implementation of AlreadyConnectedToAddress uses 2 methods to determine if the node is already connected to the candidate. First it searches by ip address (CNetAddr) then by ip:port (ToStringIPPort()). The first one is inconsistent with the other places in the codebase, and inconsistent with how addrman stores the peers data (based on CService, which is an ip:port object). This piece of code will prevent the node from connecting several nodes sharing the same ip but with a different port via outbound connections, which is not really a problem for core as it has a limited number of outbounds, but becomes a problem for eCash with avalanche where we should be able to connect all the peers.
Details
Details
- Reviewers
PiRK - Group Reviewers
Restricted Project - Commits
- rABC02b4774d7c24: [net] Consistently check for existing connection based on ip:port
ninja all check-all
Diff Detail
Diff Detail
- Repository
- rABC Bitcoin ABC
- Branch
- already_connected_service
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 28250 Build 56045: Build Diff build-clang-tidy · build-without-wallet · build-clang · lint-circular-dependencies · build-debug · build-diff Build 56044: arc lint + arc unit