This is an alternative to #8097 that:
- Maintains consistency between
ThreadOpenAddedNodeConnectionsandgetaddednodeinfo, 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
GetAddedNodeInfoin net.cpp. - The existing
addnodelogic that tries all resolved addresses for a name is pushed down intoConnectSocketByName(picking at random). - The existing
addnodelogic to prevent multiple connections to the same IP is pushed down intoConnectNode(by storing colliding names into the CNode’s addrName field).
Untested.