Consensus: Remove calls to error() from ContextualCheckBlock #8341

pull NicolasDorier wants to merge 1 commits into bitcoin:master from NicolasDorier:error-calls changing 1 files +4 −4
  1. NicolasDorier commented at 3:07 am on July 15, 2016: contributor

    There is only two callers of ContextualCheckBlock, and they already print errors:

    https://github.com/bitcoin/bitcoin/blob/master/src/main.cpp#L3780 https://github.com/bitcoin/bitcoin/blob/master/src/main.cpp#L3689

    It is using the same way as #7287 by @jtimon

  2. jtimon commented at 11:23 am on July 15, 2016: contributor
    ACK e7ad8a7
  3. in src/main.cpp: in e7ad8a7227 outdated
    3572@@ -3573,11 +3573,11 @@ bool ContextualCheckBlock(const CBlock& block, CValidationState& state, CBlockIn
    3573             // already does not permit it, it is impossible to trigger in the
    3574             // witness tree.
    3575             if (block.vtx[0].wit.vtxinwit.size() != 1 || block.vtx[0].wit.vtxinwit[0].scriptWitness.stack.size() != 1 || block.vtx[0].wit.vtxinwit[0].scriptWitness.stack[0].size() != 32) {
    3576-                return state.DoS(100, error("%s : invalid witness nonce size", __func__), REJECT_INVALID, "bad-witness-nonce-size", true);
    3577+                return state.DoS(100, false, REJECT_INVALID, "bad-witness-nonce-size", true, strprintf("%s : invalid witness nonce size", __func__));
    


    jtimon commented at 11:25 am on July 15, 2016:
    I’m not sure if it’s worth keeping the func but I’m not against it.

    laanwj commented at 10:00 am on July 21, 2016:
    Tend to agree with @jtimon. I think it was removed in other places where information was migrated to the debug message.

    sipa commented at 10:58 am on July 21, 2016:
    Agree with removing. I don’t think function names are very useful to most debug.log readers, and to those that are, you can just grep the source code for the message. Though perhaps we should do a combined effort of fixing it everywhere. ACK with or without func
  4. btcdrak commented at 10:34 am on July 16, 2016: contributor
    ACK e7ad8a7
  5. laanwj commented at 10:00 am on July 21, 2016: member
    Needs rebase
  6. sipa commented at 10:59 am on July 21, 2016: member
    utACK (with or without func), but needs rebase.
  7. NicolasDorier force-pushed on Jul 21, 2016
  8. Consensus: Remove calls to error() from ContextualCheckBlock 7821889bce
  9. NicolasDorier force-pushed on Jul 21, 2016
  10. NicolasDorier commented at 11:57 am on July 21, 2016: contributor
    rebased
  11. laanwj added the label Refactoring on Jul 21, 2016
  12. laanwj merged this on Jul 21, 2016
  13. laanwj closed this on Jul 21, 2016

  14. laanwj referenced this in commit 04af3cfe8f on Jul 21, 2016
  15. 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-23 09:12 UTC

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