[script] Return early if no valid opcodes found in CountWitnessSigOps(...) #10975

pull practicalswift wants to merge 1 commits into bitcoin:master from practicalswift:return-early-in-CountWitnessSigOps changing 1 files +7 −1
  1. practicalswift commented at 8:06 AM on August 2, 2017: contributor

    Return early if no valid opcodes found in CountWitnessSigOps(...).

    Prior to this commit this was the only place in the codebase where GetOp(...) was called without checking the return value.

  2. [script] Return early if no valid opcodes found in CountWitnessSigOps(...)
    Prior to this commit this was the only place in the codebase where
    GetOp(...) was called without checking the return value.
    11d50a416f
  3. jonasschnelli added the label Refactoring on Aug 3, 2017
  4. in src/script/interpreter.cpp:1568 in 11d50a416f
    1564 | +            if (scriptSig.GetOp(pc, opcode, data)) {
    1565 | +                hasValidOp = true;
    1566 | +            }
    1567 | +        }
    1568 | +        if (!hasValidOp) {
    1569 | +            return 0;
    


    promag commented at 3:36 PM on August 6, 2017:

    This is not an obvious early return, because one has to go deeper in IsWitnessProgram.

  5. promag commented at 3:37 PM on August 6, 2017: member

    Concept ACK.

  6. promag commented at 3:39 PM on August 6, 2017: member

    Nit, reword to use your usual prefix script:.

  7. practicalswift renamed this:
    [script] Return early if no valid opcodes found in CountWitnessSigOps(...)
    script: Return early if no valid opcodes found in CountWitnessSigOps(...)
    on Aug 6, 2017
  8. practicalswift renamed this:
    script: Return early if no valid opcodes found in CountWitnessSigOps(...)
    [script] Return early if no valid opcodes found in CountWitnessSigOps(...)
    on Aug 23, 2017
  9. practicalswift closed this on Jan 31, 2018

  10. practicalswift deleted the branch on Apr 10, 2021
  11. DrahtBot locked this on Aug 16, 2022

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: 2026-04-16 15:15 UTC

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