Make TestBlockValidity optional in CreateNewBlock #9859

pull jameshilliard wants to merge 1 commits into bitcoin:master from jameshilliard:tbv-optional changing 6 files +15 −6
  1. jameshilliard commented at 0:01 am on February 26, 2017: contributor
    This is an alternative to #9858
  2. fanquake added the label Mining on Feb 26, 2017
  3. jameshilliard force-pushed on Feb 26, 2017
  4. Make TestBlockValidity optional in CreateNewBlock 2d29f51f8b
  5. jameshilliard force-pushed on Feb 26, 2017
  6. in src/validation.h: in 2d29f51f8b
    130@@ -131,6 +131,7 @@ static const int64_t MAX_FEE_ESTIMATION_TIP_AGE = 3 * 60 * 60;
    131 /** Default for -permitbaremultisig */
    132 static const bool DEFAULT_PERMIT_BAREMULTISIG = true;
    133 static const bool DEFAULT_CHECKPOINTS_ENABLED = true;
    134+static const bool DEFAULT_TEST_CNBVALID = false;
    


    luke-jr commented at 1:51 am on February 26, 2017:
    At the very least, this should default to true.

    jameshilliard commented at 2:32 am on February 26, 2017:
    This seems like it should just be a debug option that’s off by default since it’s something that should never be needed unless there’s an internal bug.
  7. in src/init.cpp: in 2d29f51f8b
    380@@ -381,6 +381,8 @@ std::string HelpMessage(HelpMessageMode mode)
    381     strUsage += HelpMessageOpt("-proxyrandomize", strprintf(_("Randomize credentials for every proxy connection. This enables Tor stream isolation (default: %u)"), DEFAULT_PROXYRANDOMIZE));
    382     strUsage += HelpMessageOpt("-rpcserialversion", strprintf(_("Sets the serialization of raw transaction or block hex returned in non-verbose mode, non-segwit(0) or segwit(1) (default: %d)"), DEFAULT_RPC_SERIALIZE_VERSION));
    383     strUsage += HelpMessageOpt("-seednode=<ip>", _("Connect to a node to retrieve peer addresses, and disconnect"));
    384+    if (showDebug)
    


    luke-jr commented at 1:51 am on February 26, 2017:
    Needs braces

    jameshilliard commented at 2:30 am on February 26, 2017:
    This is the style used above for single debug config options
  8. luke-jr changes_requested
  9. in src/test/miner_tests.cpp: in 2d29f51f8b
    198@@ -199,6 +199,7 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity)
    199 
    200     LOCK(cs_main);
    201     fCheckpointsEnabled = false;
    202+    fRunTestBlockValidity = true;
    


    jtimon commented at 5:38 pm on March 7, 2017:
    Instead of using the global for the tests, true can be passed in the tests directly to CreateNewBlock() as in #9858 . All other calls of CreateNewBlock() can use the global fRunTestBlockValidity
  10. fanquake commented at 7:56 am on November 28, 2017: member
    Going to close this for now. Needs a rebase, and hasn’t had much discussion. Can be re-opened if/when necessary.
  11. fanquake closed this on Nov 28, 2017

  12. 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-21 15:12 UTC

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