luke-jr constants #6961

pull MarcoFalke wants to merge 4 commits into bitcoin:master from MarcoFalke:luke-jr-const changing 29 files +157 −99
  1. MarcoFalke commented at 11:28 am on November 6, 2015: member

    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.

  2. in src/init.cpp: in 82fcf8b501 outdated
    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));
    


    MarcoFalke commented at 12:00 pm on November 6, 2015:
    Nit: Reuse translation?
  3. in src/init.cpp: in 82fcf8b501 outdated
    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;
    


    laanwj commented at 1:14 pm on November 6, 2015:
    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)
  4. dcousens commented at 1:14 pm on November 6, 2015: contributor
    utACK
  5. in src/util.h: in 82fcf8b501 outdated
    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;
    


    laanwj commented at 1:16 pm on November 6, 2015:
    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.

    dcousens commented at 2:52 am on November 7, 2015:
    Agreed, plus if disable wallet is enabled, it’ll possibly throw a tonne of unused variable warnings (assuming -Wnounused)

    dcousens commented at 2:53 am on November 7, 2015:
    For reference, @laanwj you meant DEFAULT_SPLASHSCREEN (and DEFAULT_CHOOSE_DATADIR?)?

    MarcoFalke commented at 4:57 pm on November 7, 2015:
    @laanwj @dcousens So where would I put those? qt/guiconstants.h? Or ratherqt/paymentrequestplus.h, qt/intro.h
  6. laanwj added the label Refactoring on Nov 6, 2015
  7. MarcoFalke force-pushed on Nov 6, 2015
  8. MarcoFalke force-pushed on Nov 7, 2015
  9. MarcoFalke force-pushed on Nov 7, 2015
  10. MarcoFalke force-pushed on Nov 9, 2015
  11. MarcoFalke commented at 11:44 am on November 9, 2015: member
    Rebased. (Due to the translations cleanup) @laanwj Is it ok with the gui constants like this?
  12. laanwj commented at 2:27 pm on November 9, 2015: member

    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.

  13. MarcoFalke force-pushed on Nov 9, 2015
  14. MarcoFalke force-pushed on Nov 9, 2015
  15. MarcoFalke force-pushed on Nov 9, 2015
  16. MarcoFalke commented at 7:38 pm on November 9, 2015: member
    I put them in HelpMessageDialog()
  17. laanwj commented at 2:52 pm on November 10, 2015: member

    I put them in HelpMessageDialog()

    That’s awesome. They originally came from there and they shouldn’t have been moved. Thanks!

    ACK

  18. in src/netbase.cpp: in 2582225ca1 outdated
    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;
    


    laanwj commented at 2:54 pm on November 10, 2015:
    Why do you change this default? ok it isn’t changed it was always true
  19. in src/init.cpp: in 2582225ca1 outdated
    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);
    


    laanwj commented at 2:54 pm on November 10, 2015:
    Please define DEFAULT_* constant for this, instead of passing through the old value of the global.

    MarcoFalke commented at 10:24 pm on November 10, 2015:
    @laanwj Done.
  20. MarcoFalke commented at 11:00 am on November 12, 2015: member
    Anything holding this back?
  21. MarcoFalke force-pushed on Nov 12, 2015
  22. MarcoFalke force-pushed on Nov 16, 2015
  23. MarcoFalke force-pushed on Nov 17, 2015
  24. MarcoFalke force-pushed on Nov 26, 2015
  25. MarcoFalke commented at 9:50 pm on November 26, 2015: member
    Rebased
  26. sipa commented at 0:51 am on November 28, 2015: member
    Concept ACK, I haven’t checked the code changes in detail yet, but needs rebase (again…).
  27. Constrain constant values to a single location in code b966aa836a
  28. Bugfix: Omit wallet-related options from -help when wallet is not supported 3307bdb333
  29. [trivial] Reuse translation and cleanup DEFAULT_* values
    * DEFAULT_DISABLE_SAFEMODE = false
    * Use DEFAULT_* constants for extern bools
    faf93f37fe
  30. [qt] Move GUI related HelpMessage() part downstream fa41d4c8c6
  31. MarcoFalke force-pushed on Nov 28, 2015
  32. MarcoFalke commented at 8:47 pm on November 28, 2015: member

    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.

  33. in src/util.h: in fa41d4c8c6
    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;
    


    sipa commented at 9:04 pm on November 28, 2015:
    This was false.

    sipa commented at 9:07 pm on November 28, 2015:
    Never mind. The fLogTimestamps variable was initialized to false before, but the default setting was true. This makes it more consistent. Good.
  34. sipa commented at 9:12 pm on November 28, 2015: member
    ACK. Read over all the code changes, and compared the output of bitcoind and bitcoin-qt’s –help output.
  35. sipa merged this on Nov 28, 2015
  36. sipa closed this on Nov 28, 2015

  37. sipa referenced this in commit 8d26289c9a on Nov 28, 2015
  38. MarcoFalke deleted the branch on Nov 28, 2015
  39. luke-jr referenced this in commit a1c27c33f0 on Nov 30, 2015
  40. luke-jr referenced this in commit 72c9ac6180 on Dec 8, 2015
  41. zkbot referenced this in commit f1aeaec471 on Mar 21, 2018
  42. str4d referenced this in commit 5c76b1df64 on Nov 14, 2019
  43. str4d referenced this in commit de2eddd21d on Dec 3, 2019
  44. zkbot referenced this in commit 4fc490c430 on Dec 4, 2019
  45. zkbot referenced this in commit 868c63f92d on Dec 4, 2019
  46. random-zebra referenced this in commit e89e20eca1 on Aug 25, 2020
  47. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-19 03:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me