Update p2p-segwit.py to reflect correct behavior #8528

pull instagibbs wants to merge 2 commits into bitcoin:master from instagibbs:rejectsw changing 1 files +7 −3
  1. instagibbs commented at 7:11 PM on August 16, 2016: member
    1. The tx entry from mapAlreadyAskedFor is erased as soon as it is received, and it doesn't enter the reject filter even though it's invalid, so we can immediately announce the transaction again and receive a getdata for that tx.
    2. An example transaction is being rejected due to premature witness, not size
  2. Update p2p-segwit.py to reflect correct AskFor behavior bc1d1f2660
  3. instagibbs renamed this:
    Update p2p-segwit.py to reflect correct AskFor behavior
    Update p2p-segwit.py to reflect correct behavior
    on Aug 16, 2016
  4. jonasschnelli added the label Tests on Aug 17, 2016
  5. p2psegwit.py transaction is rejected due to premature witness not size 5547aeb015
  6. in qa/rpc-tests/p2p-segwit.py:None in 66e0547df2 outdated
     307 |          tx3 = CTransaction()
     308 |          tx3.vin.append(CTxIn(COutPoint(tx2.sha256, 0), CScript([p2sh_program])))
     309 |          tx3.vout.append(CTxOut(tx2.vout[0].nValue-1000, scriptPubKey))
     310 |          tx3.wit.vtxinwit.append(CTxInWitness())
     311 | -        tx3.wit.vtxinwit[0].scriptWitness.stack = [b'a'*400000]
     312 | +        tx3.wit.vtxinwit[0].scriptWitness.stack = [b'a']
    


    sdaftuar commented at 2:01 PM on August 18, 2016:

    Ah, this code could be commented better I think. I did intend for the transaction to be too large for standardness rules, to ensure that we were checking for premature witness before doing the IsStandard check (that change was a recent bugfix). Perhaps just improve the comment, rather than change the test itself?


    instagibbs commented at 2:05 PM on August 18, 2016:

    I'm not exactly clear what you were shooting for, so feel free to suggest new text?


    sdaftuar commented at 2:30 PM on August 18, 2016:

    What do you think of this:

    # We'll add an unnecessary witness to this transaction that would cause 
    # it to be non-standard, to test that violating policy with a witness before 
    # segwit activation doesn't blind a node to a transaction.  Transactions
    # rejected for having a witness before segwit activation shouldn't be added
    # to the rejection cache.
    

    And then at line 312, add a comment:

    # Note that this should be rejected for the premature witness reason,
    # rather than a policy check, since segwit hasn't activated yet.
    

    instagibbs commented at 3:03 PM on August 18, 2016:

    sounds good, pushed

  7. instagibbs force-pushed on Aug 18, 2016
  8. jonasschnelli added this to the milestone 0.13.1 on Aug 30, 2016
  9. jonasschnelli added the label Needs backport on Aug 30, 2016
  10. sdaftuar commented at 4:39 PM on September 9, 2016: member

    utACK

  11. btcdrak commented at 12:26 PM on September 12, 2016: contributor

    utACK 5547aeb

  12. laanwj commented at 9:03 AM on September 13, 2016: member

    utACK 5547aeb

  13. laanwj merged this on Sep 13, 2016
  14. laanwj closed this on Sep 13, 2016

  15. laanwj referenced this in commit 4ced5de71d on Sep 13, 2016
  16. luke-jr referenced this in commit 3606b6b3a7 on Sep 21, 2016
  17. luke-jr referenced this in commit a114a0208b on Sep 21, 2016
  18. laanwj removed the label Needs backport on Sep 26, 2016
  19. laanwj commented at 1:49 PM on September 26, 2016: member

    This is backported in #8772, removing needs-backport tag.

  20. DrahtBot locked this on Sep 8, 2021
Labels

Milestone
0.13.1


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-27 03:16 UTC

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