File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -302,13 +302,18 @@ def test_unnecessary_witness_before_segwit_activation(self):
302
302
sync_blocks (self .nodes )
303
303
304
304
# 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.
306
309
tx3 = CTransaction ()
307
310
tx3 .vin .append (CTxIn (COutPoint (tx2 .sha256 , 0 ), CScript ([p2sh_program ])))
308
311
tx3 .vout .append (CTxOut (tx2 .vout [0 ].nValue - 1000 , scriptPubKey ))
309
312
tx3 .wit .vtxinwit .append (CTxInWitness ())
310
313
tx3 .wit .vtxinwit [0 ].scriptWitness .stack = [b'a' * 400000 ]
311
314
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.
312
317
self .std_node .test_transaction_acceptance (tx3 , True , False , b'no-witness-yet' )
313
318
314
319
# If we send without witness, it should be accepted.
You can’t perform that action at this time.
0 commit comments