Parameter interaction: disable upnp if -proxy set

To protect privacy, do not use UPNP when a proxy is set. The user may
still specify -listen=1 to listen locally (for a hidden service), so
don't rely on this happening through -listen.

Fixes #2927.

Conflicts:
	src/init.cpp

Rebased-From: 8c35b6f3be
Github-Pull: #6153
This commit is contained in:
Wladimir J. van der Laan 2015-05-18 11:21:32 +02:00
parent ae3d8f371a
commit ebd7d8d78c
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
1 changed files with 5 additions and 1 deletions

View File

@ -593,7 +593,11 @@ bool AppInit2(boost::thread_group& threadGroup)
if (mapArgs.count("-proxy")) {
// to protect privacy, do not listen by default if a default proxy server is specified
if (SoftSetBoolArg("-listen", false))
LogPrintf("AppInit2 : parameter interaction: -proxy set -> setting -listen=0\n");
LogPrintf("%s: parameter interaction: -proxy set -> setting -listen=0\n", __func__);
// to protect privacy, do not use UPNP when a proxy is set. The user may still specify -listen=1
// to listen locally, so don't rely on this happening through -listen below.
if (SoftSetBoolArg("-upnp", false))
LogPrintf("%s: parameter interaction: -proxy set -> setting -upnp=0\n", __func__);
// to protect privacy, do not discover addresses by default
if (SoftSetBoolArg("-discover", false))
LogPrintf("AppInit2 : parameter interaction: -proxy set -> setting -discover=0\n");