aboutsummaryrefslogtreecommitdiff
path: root/src/init.cpp
diff options
context:
space:
mode:
authorCory Fields <cory-nospam-@coryfields.com>2016-05-31 13:51:11 -0400
committerCory Fields <cory-nospam-@coryfields.com>2016-07-31 13:24:07 -0400
commitf96c7c4d91f3c09d26658bc9c15aa561689fa2d4 (patch)
tree4fc6bff63eff752e4791ae3fb64de77b427afeee /src/init.cpp
parent31d6b1d5f0414d8b356d8cb9c99961d8a04d6c0a (diff)
net: Split resolving out of CService
Diffstat (limited to 'src/init.cpp')
-rw-r--r--src/init.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 8d4a2cafbf..77ecf05f1d 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -1096,7 +1096,9 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
std::string proxyArg = GetArg("-proxy", "");
SetLimited(NET_TOR);
if (proxyArg != "" && proxyArg != "0") {
- proxyType addrProxy = proxyType(CService(proxyArg, 9050), proxyRandomize);
+ CService resolved;
+ LookupNumeric(proxyArg.c_str(), resolved, 9050);
+ proxyType addrProxy = proxyType(resolved, proxyRandomize);
if (!addrProxy.IsValid())
return InitError(strprintf(_("Invalid -proxy address: '%s'"), proxyArg));
@@ -1115,7 +1117,9 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
if (onionArg == "0") { // Handle -noonion/-onion=0
SetLimited(NET_TOR); // set onions as unreachable
} else {
- proxyType addrOnion = proxyType(CService(onionArg, 9050), proxyRandomize);
+ CService resolved;
+ LookupNumeric(onionArg.c_str(), resolved, 9050);
+ proxyType addrOnion = proxyType(resolved, proxyRandomize);
if (!addrOnion.IsValid())
return InitError(strprintf(_("Invalid -onion address: '%s'"), onionArg));
SetProxy(NET_TOR, addrOnion);