[qa] Fix rare failure in p2p-segwit.py #12133

pull sdaftuar wants to merge 1 commits into bitcoin:master from sdaftuar:2018-01-fix-p2p-segwit changing 1 files +8 −6
  1. sdaftuar commented at 6:39 PM on January 9, 2018: member

    Avoid creating very small utxos that would violate an assumption in test_non_standard_witness.

    Fixes #11953

  2. in test/functional/p2p-segwit.py:1412 in 7fe5b20097 outdated
    1411 |              # the signatures as we go.
    1412 |              tx.vin.append(CTxIn(COutPoint(i.sha256, i.n), b""))
    1413 | -            tx.vout.append(CTxOut(i.nValue, CScript([OP_TRUE])))
    1414 |              tx.wit.vtxinwit.append(CTxInWitness())
    1415 | -            sign_P2PK_witness_input(witness_program, tx, index, SIGHASH_SINGLE|SIGHASH_ANYONECANPAY, i.nValue, key)
    1416 | +            sign_P2PK_witness_input(witness_program, tx, index, SIGHASH_ALL|SIGHASH_ANYONECANPAY, i.nValue, key)
    


    instagibbs commented at 7:05 PM on January 9, 2018:

    why this change?


    sdaftuar commented at 7:06 PM on January 9, 2018:

    It felt wrong to use SIGHASH_SINGLE with an out-of-bounds index.


    instagibbs commented at 7:08 PM on January 9, 2018:

    ah, ok then comment could use an update a few lines up.


    sdaftuar commented at 7:10 PM on January 9, 2018:

    Oops! Thanks, will fix.

  3. sdaftuar force-pushed on Jan 9, 2018
  4. Fix rare failure in p2p-segwit.py
    Avoid creating very small utxos that would violate an assumption in
    test_non_standard_witness.
    35c2b1fe3b
  5. sdaftuar force-pushed on Jan 9, 2018
  6. jnewbery commented at 9:39 PM on January 9, 2018: member

    Tested ACk 35c2b1fe3b1a046bbd1bfaf1c178e838d047277a

  7. MarcoFalke commented at 5:02 PM on January 10, 2018: member

    Thanks!

    utACK 35c2b1fe3b1a046bbd1bfaf1c178e838d047277a. Created a similar fix last year, but somehow forgot to submit it.

  8. ryanofsky commented at 9:28 PM on January 10, 2018: member

    utACK 35c2b1fe3b1a046bbd1bfaf1c178e838d047277a. Change makes sense, but I couldn't figure out what problem the previous outputs caused in test_non_standard_witness.

  9. MarcoFalke commented at 9:46 PM on January 10, 2018: member

    In test_non_standard_witness, you subtract the fee at some point. Having really small outputs, this could lead to negative outputs, provoking the "bad-txns-vout-negative". The smallest observed value depends on the test run and the exception is hit very rarely non-deterministically.

  10. instagibbs commented at 9:49 PM on January 10, 2018: member

    Yes the PR comment makes it sound like it's a non-standard witness, rather than non-standard output.

  11. fanquake added the label Tests on Jan 11, 2018
  12. laanwj commented at 1:47 PM on January 11, 2018: member

    utACK 35c2b1f

  13. laanwj merged this on Jan 11, 2018
  14. laanwj closed this on Jan 11, 2018

  15. laanwj referenced this in commit 1d2eaba300 on Jan 11, 2018
  16. DrahtBot 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: 2026-04-14 12:15 UTC

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