Skip to content

Commit

Permalink
net: remove now-superfluous numeric resolve
Browse files Browse the repository at this point in the history
This was added in order to help OpenNetworkConnection avoid creating a
connection that it would end up aborting. It was necessary because resolving
was done as part of the connection process.

Now that resolving is separated from connecting, this case is detected before
the connection is attempted.
  • Loading branch information
theuni committed Sep 18, 2017
1 parent 2416dd7 commit 45fd754
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1934,11 +1934,9 @@ void CConnman::ThreadOpenAddedConnections()
// the addednodeinfo state might change.
break;
}
// If strAddedNode is an IP/port, decode it immediately, so
// OpenNetworkConnection can detect existing connections to that IP/port.
tried = true;
CService service(LookupNumeric(info.strAddedNode.c_str(), Params().GetDefaultPort()));
OpenNetworkConnection(CAddress(service, NODE_NONE), false, &grant, info.strAddedNode.c_str(), false, false, true);
CAddress addr(CService(), NODE_NONE);
OpenNetworkConnection(addr, false, &grant, info.strAddedNode.c_str(), false, false, true);
if (!interruptNet.sleep_for(std::chrono::milliseconds(500)))
return;
}
Expand Down

0 comments on commit 45fd754

Please sign in to comment.