aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2015-11-27 14:17:10 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2015-11-27 15:07:49 +0100
commitd6454f6cb23e3af0dae84a70aee57aed54bca04b (patch)
tree38677df791291eca1fff4d4af62a5de73ed8eca0
parentd8368a07baf2a6555557c038cbcecb615c24bdf6 (diff)
parentcde857f2d977fbe3f96c093f6ca3c9810494191d (diff)
Merge pull request #7090
cde857f Connect to Tor hidden services by default (Peter Todd)
-rw-r--r--doc/release-notes.md9
-rw-r--r--src/torcontrol.cpp9
2 files changed, 14 insertions, 4 deletions
diff --git a/doc/release-notes.md b/doc/release-notes.md
index 7db27f9fac..009baaed51 100644
--- a/doc/release-notes.md
+++ b/doc/release-notes.md
@@ -151,8 +151,8 @@ mining with the getblocktemplate protocol to a pool: this will affect you at
the pool operator's discretion, which must be no later than BIP65 achieving its
951/1001 status.
-Automatically listen on Tor
-----------------------------
+Automatically use Tor hidden services
+-------------------------------------
Starting with Tor version 0.2.7.1 it is possible, through Tor's control socket
API, to create and destroy 'ephemeral' hidden services programmatically.
@@ -160,8 +160,9 @@ Bitcoin Core has been updated to make use of this.
This means that if Tor is running (and proper authorization is available),
Bitcoin Core automatically creates a hidden service to listen on, without
-manual configuration. This will positively affect the number of available
-.onion nodes.
+manual configuration. Bitcoin Core will also use Tor automatically to connect
+to other .onion nodes if the control socket can be successfully opened. This
+will positively affect the number of available .onion nodes and their usage.
This new feature is enabled by default if Bitcoin Core is listening, and
a connection to Tor can be made. It can be configured with the `-listenonion`,
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";