Rebased version of #6349 (2/3).
I have dropped the changes to src/chainparamsbase.cpp to only include code that has already been reviewed as part of #6349.
349 | + strUsage += HelpMessageOpt("-bantime=<n>", strprintf(_("Number of seconds to keep misbehaving peers from reconnecting (default: %u)"), DEFAULT_MISBEHAVING_BANTIME)); 350 | strUsage += HelpMessageOpt("-bind=<addr>", _("Bind to given address and always listen on it. Use [host]:port notation for IPv6")); 351 | strUsage += HelpMessageOpt("-connect=<ip>", _("Connect only to the specified node(s)")); 352 | strUsage += HelpMessageOpt("-discover", _("Discover own IP addresses (default: 1 when listening and no -externalip or -proxy)")); 353 | - strUsage += HelpMessageOpt("-dns", _("Allow DNS lookups for -addnode, -seednode and -connect") + " " + _("(default: 1)")); 354 | + strUsage += HelpMessageOpt("-dns", strprintf(_("Allow DNS lookups for -addnode, -seednode and -connect (default: %u)"), fNameLookup));
Nit: Reuse translation?
64 | @@ -64,6 +65,10 @@ using namespace std; 65 | CWallet* pwalletMain = NULL; 66 | #endif 67 | bool fFeeEstimatesInitialized = false; 68 | +static const bool DEFAULT_PROXYRANDOMIZE = true; 69 | +static const bool DEFAULT_REST_ENABLE = false; 70 | +static const bool DEFAULT_SAFEMODE = true;
I'd prefer to use DEFAULT_DISABLESAFEMODE = false then use that instead of negating this everywhere it is used.
(agree that in retrospect the option should have been called safemode and acted in this way, but there's no way back now, and having this consistent makes it easier to link it to the constant)
utACK
50 | @@ -51,6 +51,13 @@ extern bool fLogIPs; 51 | extern volatile bool fReopenDebugLog; 52 | extern CTranslationInterface translationInterface; 53 | 54 | +extern const char * const BITCOIN_CONF_FILENAME; 55 | +extern const char * const BITCOIN_PID_FILENAME; 56 | + 57 | +static const bool DEFAULT_SELFSIGNED_ROOTCERTS = false; 58 | +static const bool DEFAULT_CHOOSE_DATADIR = false;
It's ugly to have defaults for these GUI specific options in the core, they are not related to util at all. IMO the help for GUI specific options should be moved to the GUI part of the code.
Agreed, plus if disable wallet is enabled, it'll possibly throw a tonne of unused variable warnings (assuming -Wnounused)
Rebased. (Due to the translations cleanup) @laanwj Is it ok with the gui constants like this?
I don't like including a GUI header from the core. We don't do that anywhere.
I'd prefer moving the part of HelpMessage with GUI specific settings to the GUI code.
I put them in HelpMessageDialog()
I put them in HelpMessageDialog()
That's awesome. They originally came from there and they shouldn't have been moved. Thanks!
ACK
39 | @@ -40,7 +40,7 @@ static proxyType proxyInfo[NET_MAX]; 40 | static proxyType nameProxy; 41 | static CCriticalSection cs_proxyInfos; 42 | int nConnectTimeout = DEFAULT_CONNECT_TIMEOUT; 43 | -bool fNameLookup = false;
Why do you change this default? ok it isn't changed it was always true
1125 | @@ -1134,7 +1126,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) 1126 | // see Step 2: parameter interactions for more information about these 1127 | fListen = GetBoolArg("-listen", DEFAULT_LISTEN); 1128 | fDiscover = GetBoolArg("-discover", true); 1129 | - fNameLookup = GetBoolArg("-dns", true); 1130 | + fNameLookup = GetBoolArg("-dns", fNameLookup);
Please define DEFAULT_* constant for this, instead of passing through the old value of the global.
@laanwj Done.
Anything holding this back?
Rebased
Concept ACK, I haven't checked the code changes in detail yet, but needs rebase (again...).
* DEFAULT_DISABLE_SAFEMODE = false
* Use DEFAULT_* constants for extern bools
Rebased.
I haven't checked the code changes in detail yet, but needs rebase (again...).
This needs rebase approximately every 4 days. I checked the code as of #6349 and verified each rebase twice. Though, I don't think constant rebase makes this PR any better.
28 | @@ -29,6 +29,8 @@ 29 | #include <boost/thread/exceptions.hpp> 30 | 31 | static const bool DEFAULT_LOGTIMEMICROS = false; 32 | +static const bool DEFAULT_LOGIPS = false; 33 | +static const bool DEFAULT_LOGTIMESTAMPS = true;
This was false.
Never mind. The fLogTimestamps variable was initialized to false before, but the default setting was true. This makes it more consistent. Good.
ACK. Read over all the code changes, and compared the output of bitcoind and bitcoin-qt's --help output.