aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/torcontrol.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/torcontrol.cpp b/src/torcontrol.cpp
index 08644f2968..31a2917203 100644
--- a/src/torcontrol.cpp
+++ b/src/torcontrol.cpp
@@ -449,6 +449,15 @@ void TorController::auth_cb(TorControlConnection& conn, const TorControlReply& r
{
if (reply.code == 250) {
LogPrint("tor", "tor: Authentication succesful\n");
+
+ // 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);
+ SetProxy(NET_TOR, addrOnion);
+ SetReachable(NET_TOR);
+ }
+
// Finally - now create the service
if (private_key.empty()) // No private key, generate one
private_key = "NEW:BEST";