diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2016-08-15 13:33:46 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2016-08-15 13:35:27 +0200 |
commit | 1030fa718c59c29d3208af13e853457b7ac59d2e (patch) | |
tree | f2ba7f33f972be99ef8198e3e9676131b8f2dc8f /src/torcontrol.cpp | |
parent | d727f77e390426e9e463336bda08d50c451c7086 (diff) | |
parent | 9e9d644f5178da8b5743ea3ddc3b779a2c8d1cd4 (diff) |
Merge #8128: Net: Turn net structures into dumb storage classes
9e9d644 net: fixup nits (Cory Fields)
8945384 net: Have LookupNumeric return a CService directly (Cory Fields)
21ba407 net: narrow include scope after moving to netaddress (Cory Fields)
21e5b96 net: move CNetAddr/CService/CSubNet out of netbase (Cory Fields)
1017b8a net: Add direct tests for new CSubNet constructors (Cory Fields)
b6c3ff3 net: Split resolving out of CSubNet (Cory Fields)
f96c7c4 net: Split resolving out of CService (Cory Fields)
31d6b1d net: Split resolving out of CNetAddr (Cory Fields)
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..99c45d489c 100644 --- a/src/torcontrol.cpp +++ b/src/torcontrol.cpp @@ -4,6 +4,7 @@ #include "torcontrol.h" #include "utilstrencodings.h" +#include "netbase.h" #include "net.h" #include "util.h" #include "crypto/hmac_sha256.h" @@ -437,8 +438,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()); + service = LookupNumeric(std::string(service_id+".onion").c_str(), 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 +462,8 @@ 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(LookupNumeric("127.0.0.1", 9050)); + proxyType addrOnion = proxyType(resolved, true); SetProxy(NET_TOR, addrOnion); SetLimited(NET_TOR, false); } |