Skip to content

Commit 9b818ed

Browse files
committed
Merge pull request #3588
df966d1 log parameter interactions to debug.log (Philip Kaufmann)
2 parents 3581abd + df966d1 commit 9b818ed

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

src/init.cpp

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -415,34 +415,42 @@ bool AppInit2(boost::thread_group& threadGroup)
415415
if (mapArgs.count("-bind")) {
416416
// when specifying an explicit binding address, you want to listen on it
417417
// even when -connect or -proxy is specified
418-
SoftSetBoolArg("-listen", true);
418+
if (SoftSetBoolArg("-listen", true))
419+
LogPrintf("AppInit2 : parameter interaction: -bind set -> setting -listen=1\n");
419420
}
420421

421422
if (mapArgs.count("-connect") && mapMultiArgs["-connect"].size() > 0) {
422423
// when only connecting to trusted nodes, do not seed via DNS, or listen by default
423-
SoftSetBoolArg("-dnsseed", false);
424-
SoftSetBoolArg("-listen", false);
424+
if (SoftSetBoolArg("-dnsseed", false))
425+
LogPrintf("AppInit2 : parameter interaction: -connect set -> setting -dnsseed=0\n");
426+
if (SoftSetBoolArg("-listen", false))
427+
LogPrintf("AppInit2 : parameter interaction: -connect set -> setting -listen=0\n");
425428
}
426429

427430
if (mapArgs.count("-proxy")) {
428-
// to protect privacy, do not listen by default if a proxy server is specified
429-
SoftSetBoolArg("-listen", false);
431+
// to protect privacy, do not listen by default if a default proxy server is specified
432+
if (SoftSetBoolArg("-listen", false))
433+
LogPrintf("AppInit2 : parameter interaction: -proxy set -> setting -listen=0\n");
430434
}
431435

432436
if (!GetBoolArg("-listen", true)) {
433437
// do not map ports or try to retrieve public IP when not listening (pointless)
434-
SoftSetBoolArg("-upnp", false);
435-
SoftSetBoolArg("-discover", false);
438+
if (SoftSetBoolArg("-upnp", false))
439+
LogPrintf("AppInit2 : parameter interaction: -listen=0 -> setting -upnp=0\n");
440+
if (SoftSetBoolArg("-discover", false))
441+
LogPrintf("AppInit2 : parameter interaction: -listen=0 -> setting -discover=0\n");
436442
}
437443

438444
if (mapArgs.count("-externalip")) {
439445
// if an explicit public IP is specified, do not try to find others
440-
SoftSetBoolArg("-discover", false);
446+
if (SoftSetBoolArg("-discover", false))
447+
LogPrintf("AppInit2 : parameter interaction: -externalip set -> setting -discover=0\n");
441448
}
442449

443450
if (GetBoolArg("-salvagewallet", false)) {
444451
// Rewrite just private keys: rescan to find transactions
445-
SoftSetBoolArg("-rescan", true);
452+
if (SoftSetBoolArg("-rescan", true))
453+
LogPrintf("AppInit2 : parameter interaction: -salvagewallet=1 -> setting -rescan=1\n");
446454
}
447455

448456
// Make sure enough file descriptors are available

0 commit comments

Comments
 (0)