diff options
| author | Cory Fields <[email protected]> | 2016-08-04 16:37:49 -0400 |
|---|---|---|
| committer | Cory Fields <[email protected]> | 2016-08-04 16:41:39 -0400 |
| commit | 8945384bca00f74ba85c98a52925c254c49025a5 (patch) | |
| tree | c5479d77e5feb28ed75b53715073bcf3b46c1ffe /src/init.cpp | |
| parent | net: narrow include scope after moving to netaddress (diff) | |
| download | discoin-8945384bca00f74ba85c98a52925c254c49025a5.tar.xz discoin-8945384bca00f74ba85c98a52925c254c49025a5.zip | |
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/init.cpp')
| -rw-r--r-- | src/init.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/init.cpp b/src/init.cpp index 4f5eeeffe..04d7ed0ea 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1098,8 +1098,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) std::string proxyArg = GetArg("-proxy", ""); SetLimited(NET_TOR); if (proxyArg != "" && proxyArg != "0") { - CService resolved; - LookupNumeric(proxyArg.c_str(), resolved, 9050); + CService resolved(LookupNumeric(proxyArg.c_str(), 9050)); proxyType addrProxy = proxyType(resolved, proxyRandomize); if (!addrProxy.IsValid()) return InitError(strprintf(_("Invalid -proxy address: '%s'"), proxyArg)); @@ -1119,8 +1118,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) if (onionArg == "0") { // Handle -noonion/-onion=0 SetLimited(NET_TOR); // set onions as unreachable } else { - CService resolved; - LookupNumeric(onionArg.c_str(), resolved, 9050); + CService resolved(LookupNumeric(onionArg.c_str(), 9050)); proxyType addrOnion = proxyType(resolved, proxyRandomize); if (!addrOnion.IsValid()) return InitError(strprintf(_("Invalid -onion address: '%s'"), onionArg)); |