|
|
|
@ -415,34 +415,42 @@ bool AppInit2(boost::thread_group& threadGroup)
@@ -415,34 +415,42 @@ bool AppInit2(boost::thread_group& threadGroup)
|
|
|
|
|
if (mapArgs.count("-bind")) { |
|
|
|
|
// when specifying an explicit binding address, you want to listen on it
|
|
|
|
|
// even when -connect or -proxy is specified
|
|
|
|
|
SoftSetBoolArg("-listen", true); |
|
|
|
|
if (SoftSetBoolArg("-listen", true)) |
|
|
|
|
LogPrintf("AppInit2 : parameter interaction: -bind set -> setting -listen=1\n"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (mapArgs.count("-connect") && mapMultiArgs["-connect"].size() > 0) { |
|
|
|
|
// when only connecting to trusted nodes, do not seed via DNS, or listen by default
|
|
|
|
|
SoftSetBoolArg("-dnsseed", false); |
|
|
|
|
SoftSetBoolArg("-listen", false); |
|
|
|
|
if (SoftSetBoolArg("-dnsseed", false)) |
|
|
|
|
LogPrintf("AppInit2 : parameter interaction: -connect set -> setting -dnsseed=0\n"); |
|
|
|
|
if (SoftSetBoolArg("-listen", false)) |
|
|
|
|
LogPrintf("AppInit2 : parameter interaction: -connect set -> setting -listen=0\n"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (mapArgs.count("-proxy")) { |
|
|
|
|
// to protect privacy, do not listen by default if a proxy server is specified
|
|
|
|
|
SoftSetBoolArg("-listen", false); |
|
|
|
|
// 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"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!GetBoolArg("-listen", true)) { |
|
|
|
|
// do not map ports or try to retrieve public IP when not listening (pointless)
|
|
|
|
|
SoftSetBoolArg("-upnp", false); |
|
|
|
|
SoftSetBoolArg("-discover", false); |
|
|
|
|
if (SoftSetBoolArg("-upnp", false)) |
|
|
|
|
LogPrintf("AppInit2 : parameter interaction: -listen=0 -> setting -upnp=0\n"); |
|
|
|
|
if (SoftSetBoolArg("-discover", false)) |
|
|
|
|
LogPrintf("AppInit2 : parameter interaction: -listen=0 -> setting -discover=0\n"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (mapArgs.count("-externalip")) { |
|
|
|
|
// if an explicit public IP is specified, do not try to find others
|
|
|
|
|
SoftSetBoolArg("-discover", false); |
|
|
|
|
if (SoftSetBoolArg("-discover", false)) |
|
|
|
|
LogPrintf("AppInit2 : parameter interaction: -externalip set -> setting -discover=0\n"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (GetBoolArg("-salvagewallet", false)) { |
|
|
|
|
// Rewrite just private keys: rescan to find transactions
|
|
|
|
|
SoftSetBoolArg("-rescan", true); |
|
|
|
|
if (SoftSetBoolArg("-rescan", true)) |
|
|
|
|
LogPrintf("AppInit2 : parameter interaction: -salvagewallet=1 -> setting -rescan=1\n"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Make sure enough file descriptors are available
|
|
|
|
|