Skip to content

Commit

Permalink
Merge pull request #4130
Browse files Browse the repository at this point in the history
1c750db remove -tor compatibility code (only allow -onion) (Philip Kaufmann)
  • Loading branch information
laanwj committed Jun 24, 2014
2 parents 5dd0bfe + 1c750db commit 0410d11
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,9 @@ bool AppInit2(boost::thread_group& threadGroup)
// Check for -debugnet (deprecated)
if (GetBoolArg("-debugnet", false))
InitWarning(_("Warning: Deprecated argument -debugnet ignored, use -debug=net"));
// Check for -tor - as this is a privacy risk to continue, exit here
if (GetBoolArg("-tor", false))
return InitError(_("Error: Unsupported argument -tor found, use -onion."));

fBenchmark = GetBoolArg("-benchmark", false);
// Checkmempool defaults to true in regtest mode
Expand Down Expand Up @@ -767,19 +770,15 @@ bool AppInit2(boost::thread_group& threadGroup)
}

// -onion can override normal proxy, -noonion disables tor entirely
// -tor here is a temporary backwards compatibility measure
if (mapArgs.count("-tor"))
printf("Notice: option -tor has been replaced with -onion and will be removed in a later version.\n");
if (!(mapArgs.count("-onion") && mapArgs["-onion"] == "0") &&
!(mapArgs.count("-tor") && mapArgs["-tor"] == "0") &&
(fProxy || mapArgs.count("-onion") || mapArgs.count("-tor"))) {
(fProxy || mapArgs.count("-onion"))) {
CService addrOnion;
if (!mapArgs.count("-onion") && !mapArgs.count("-tor"))
if (!mapArgs.count("-onion"))
addrOnion = addrProxy;
else
addrOnion = mapArgs.count("-onion")?CService(mapArgs["-onion"], 9050):CService(mapArgs["-tor"], 9050);
addrOnion = CService(mapArgs["-onion"], 9050);
if (!addrOnion.IsValid())
return InitError(strprintf(_("Invalid -onion address: '%s'"), mapArgs.count("-onion")?mapArgs["-onion"]:mapArgs["-tor"]));
return InitError(strprintf(_("Invalid -onion address: '%s'"), mapArgs["-onion"]));
SetProxy(NET_TOR, addrOnion, 5);
SetReachable(NET_TOR);
}
Expand Down

0 comments on commit 0410d11

Please sign in to comment.