From bc1d1f266046ec79e87c7bf90aaf279f43266cf5 Mon Sep 17 00:00:00 2001 From: instagibbs Date: Tue, 16 Aug 2016 14:11:10 -0400 Subject: Update p2p-segwit.py to reflect correct AskFor behavior --- qa/rpc-tests/p2p-segwit.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'qa') diff --git a/qa/rpc-tests/p2p-segwit.py b/qa/rpc-tests/p2p-segwit.py index cd02692b1e..3813743e5b 100755 --- a/qa/rpc-tests/p2p-segwit.py +++ b/qa/rpc-tests/p2p-segwit.py @@ -946,8 +946,7 @@ class SegWitTest(BitcoinTestFramework): self.test_node.test_transaction_acceptance(tx, with_witness=True, accepted=False) # Verify that removing the witness succeeds. - # Re-announcing won't result in a getdata for ~2.5 minutes, so just - # deliver the modified transaction. + self.test_node.announce_tx_and_wait_for_getdata(tx) self.test_node.test_transaction_acceptance(tx, with_witness=False, accepted=True) # Now try to add extra witness data to a valid witness tx. -- cgit v1.2.3 From 5547aeb0159027912069b4773184963f54c672af Mon Sep 17 00:00:00 2001 From: instagibbs Date: Tue, 16 Aug 2016 15:45:42 -0400 Subject: p2psegwit.py transaction is rejected due to premature witness not size --- qa/rpc-tests/p2p-segwit.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'qa') diff --git a/qa/rpc-tests/p2p-segwit.py b/qa/rpc-tests/p2p-segwit.py index 3813743e5b..68d8b9a006 100755 --- a/qa/rpc-tests/p2p-segwit.py +++ b/qa/rpc-tests/p2p-segwit.py @@ -302,13 +302,18 @@ class SegWitTest(BitcoinTestFramework): sync_blocks(self.nodes) # We'll add an unnecessary witness to this transaction that would cause - # it to be too large according to IsStandard. + # 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. tx3 = CTransaction() tx3.vin.append(CTxIn(COutPoint(tx2.sha256, 0), CScript([p2sh_program]))) tx3.vout.append(CTxOut(tx2.vout[0].nValue-1000, scriptPubKey)) tx3.wit.vtxinwit.append(CTxInWitness()) tx3.wit.vtxinwit[0].scriptWitness.stack = [b'a'*400000] tx3.rehash() + # Note that this should be rejected for the premature witness reason, + # rather than a policy check, since segwit hasn't activated yet. self.std_node.test_transaction_acceptance(tx3, True, False, b'no-witness-yet') # If we send without witness, it should be accepted. -- cgit v1.2.3