net: Have LookupNumeric return a CService directly
This commit is contained in:
@@ -1723,8 +1723,7 @@ std::vector<AddedNodeInfo> GetAddedNodeInfo()
|
||||
}
|
||||
|
||||
BOOST_FOREACH(const std::string& strAddNode, lAddresses) {
|
||||
CService service;
|
||||
LookupNumeric(strAddNode.c_str(), service, Params().GetDefaultPort());
|
||||
CService service(LookupNumeric(strAddNode.c_str(), Params().GetDefaultPort()));
|
||||
if (service.IsValid()) {
|
||||
// strAddNode is an IP:port
|
||||
auto it = mapConnected.find(service);
|
||||
@@ -1762,8 +1761,7 @@ void ThreadOpenAddedConnections()
|
||||
CSemaphoreGrant grant(*semOutbound);
|
||||
// If strAddedNode is an IP/port, decode it immediately, so
|
||||
// OpenNetworkConnection can detect existing connections to that IP/port.
|
||||
CService service;
|
||||
LookupNumeric(info.strAddedNode.c_str(), service, Params().GetDefaultPort());
|
||||
CService service(LookupNumeric(info.strAddedNode.c_str(), Params().GetDefaultPort()));
|
||||
OpenNetworkConnection(CAddress(service, NODE_NONE), false, &grant, info.strAddedNode.c_str(), false);
|
||||
MilliSleep(500);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user