Skip to content

Commit 5547aeb

Browse files
committed
p2psegwit.py transaction is rejected due to premature witness not size
1 parent bc1d1f2 commit 5547aeb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

qa/rpc-tests/p2p-segwit.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,13 +302,18 @@ def test_unnecessary_witness_before_segwit_activation(self):
302302
sync_blocks(self.nodes)
303303

304304
# We'll add an unnecessary witness to this transaction that would cause
305-
# it to be too large according to IsStandard.
305+
# it to be non-standard, to test that violating policy with a witness before
306+
# segwit activation doesn't blind a node to a transaction. Transactions
307+
# rejected for having a witness before segwit activation shouldn't be added
308+
# to the rejection cache.
306309
tx3 = CTransaction()
307310
tx3.vin.append(CTxIn(COutPoint(tx2.sha256, 0), CScript([p2sh_program])))
308311
tx3.vout.append(CTxOut(tx2.vout[0].nValue-1000, scriptPubKey))
309312
tx3.wit.vtxinwit.append(CTxInWitness())
310313
tx3.wit.vtxinwit[0].scriptWitness.stack = [b'a'*400000]
311314
tx3.rehash()
315+
# Note that this should be rejected for the premature witness reason,
316+
# rather than a policy check, since segwit hasn't activated yet.
312317
self.std_node.test_transaction_acceptance(tx3, True, False, b'no-witness-yet')
313318

314319
# If we send without witness, it should be accepted.

0 commit comments

Comments
 (0)