diff options
| author | Peter Todd <[email protected]> | 2015-11-24 10:27:38 -0500 |
|---|---|---|
| committer | Peter Todd <[email protected]> | 2015-11-26 05:14:31 -0500 |
| commit | cde857f2d977fbe3f96c093f6ca3c9810494191d (patch) | |
| tree | 39ba7a01ccf66a0748f287facbd69596c64bcf39 /src/torcontrol.cpp | |
| parent | Merge pull request #7028 (diff) | |
| download | discoin-cde857f2d977fbe3f96c093f6ca3c9810494191d.tar.xz discoin-cde857f2d977fbe3f96c093f6ca3c9810494191d.zip | |
Connect to Tor hidden services by default
Adds 127.0.0.1:9050 for the .onion proxy if we can succesfully connect
to the control port.
Natural followup to creating hidden services automatically.
Diffstat (limited to 'src/torcontrol.cpp')
| -rw-r--r-- | src/torcontrol.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/torcontrol.cpp b/src/torcontrol.cpp index 08644f296..31a291720 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"; |