diff options
author | Cory Fields <cory-nospam-@coryfields.com> | 2016-05-31 13:51:11 -0400 |
---|---|---|
committer | Cory Fields <cory-nospam-@coryfields.com> | 2016-07-31 13:24:07 -0400 |
commit | f96c7c4d91f3c09d26658bc9c15aa561689fa2d4 (patch) | |
tree | 4fc6bff63eff752e4791ae3fb64de77b427afeee /src/torcontrol.cpp | |
parent | 31d6b1d5f0414d8b356d8cb9c99961d8a04d6c0a (diff) |
net: Split resolving out of CService
Diffstat (limited to 'src/torcontrol.cpp')
-rw-r--r-- | src/torcontrol.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/torcontrol.cpp b/src/torcontrol.cpp index 0d6b655675..d3d782747f 100644 --- a/src/torcontrol.cpp +++ b/src/torcontrol.cpp @@ -437,8 +437,7 @@ void TorController::add_onion_cb(TorControlConnection& conn, const TorControlRep if ((i = m.find("PrivateKey")) != m.end()) private_key = i->second; } - - service = CService(service_id+".onion", GetListenPort()); + LookupNumeric(std::string(service_id+".onion").c_str(), service, GetListenPort()); LogPrintf("tor: Got service ID %s, advertising service %s\n", service_id, service.ToString()); if (WriteBinaryFile(GetPrivateKeyFile(), private_key)) { LogPrint("tor", "tor: Cached service private key to %s\n", GetPrivateKeyFile()); @@ -462,7 +461,9 @@ void TorController::auth_cb(TorControlConnection& conn, const TorControlReply& r // Now that we know Tor is running setup the proxy for onion addresses // if -onion isn't set to something else. if (GetArg("-onion", "") == "") { - proxyType addrOnion = proxyType(CService("127.0.0.1", 9050), true); + CService resolved; + assert(LookupNumeric("127.0.0.1", resolved, 9050)); + proxyType addrOnion = proxyType(resolved, true); SetProxy(NET_TOR, addrOnion); SetLimited(NET_TOR, false); } |