aboutsummaryrefslogtreecommitdiff
path: root/src/net.cpp
diff options
context:
space:
mode:
authorCory Fields <cory-nospam-@coryfields.com>2016-08-04 16:37:49 -0400
committerCory Fields <cory-nospam-@coryfields.com>2016-08-04 16:41:39 -0400
commit8945384bca00f74ba85c98a52925c254c49025a5 (patch)
treec5479d77e5feb28ed75b53715073bcf3b46c1ffe /src/net.cpp
parent21ba407a7369a0229b8a8554dee0da63a64e6639 (diff)
net: Have LookupNumeric return a CService directly
Also fix up a few small issues: - Lookup with "badip:port" now sets the port to 0 - Don't allow assert to have side-effects
Diffstat (limited to 'src/net.cpp')
-rw-r--r--src/net.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/net.cpp b/src/net.cpp
index e9bb406e97..fc44a0f17c 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -1728,8 +1728,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);
@@ -1767,8 +1766,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);
}