This is an alternative to #8097 that:
- Maintains consistency between
ThreadOpenAddedNodeConnections
andgetaddednodeinfo
, without any DNS resolving from RPC. - Deals with the use case of added names whose IP mapping changes over time (switching over to the new IP only when the connection to the old one closes, though).
- Gets rid of the fDns argument to
getaddednodeinfo
(turning it into a dummy) - Simplifies the code significantly by introducing a shared
GetAddedNodeInfo
in net.cpp. - The existing
addnode
logic that tries all resolved addresses for a name is pushed down intoConnectSocketByName
(picking at random). - The existing
addnode
logic to prevent multiple connections to the same IP is pushed down intoConnectNode
(by storing colliding names into the CNode’s addrName field).
Untested.