mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 06:28:31 +01:00
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.
This commit is contained in:
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user