@@ -1357,7 +1357,8 @@ def test_tx_relay_after_segwit_activation(self):
1357
1357
def test_segwit_versions (self ):
1358
1358
"""Test validity of future segwit version transactions.
1359
1359
1360
- Future segwit version transactions are non-standard, but valid in blocks.
1360
+ Future segwit versions are non-standard to spend, but valid in blocks.
1361
+ Sending to future segwit versions is always allowed.
1361
1362
Can run this before and after segwit activation."""
1362
1363
1363
1364
NUM_SEGWIT_VERSIONS = 17 # will test OP_0, OP1, ..., OP_16
@@ -1397,18 +1398,17 @@ def test_segwit_versions(self):
1397
1398
assert len (self .nodes [0 ].getrawmempool ()) == 0
1398
1399
1399
1400
# Finally, verify that version 0 -> version 1 transactions
1400
- # are non- standard
1401
+ # are standard
1401
1402
script_pubkey = CScript ([CScriptOp (OP_1 ), witness_hash ])
1402
1403
tx2 = CTransaction ()
1403
1404
tx2 .vin = [CTxIn (COutPoint (tx .sha256 , 0 ), b"" )]
1404
1405
tx2 .vout = [CTxOut (tx .vout [0 ].nValue - 1000 , script_pubkey )]
1405
1406
tx2 .wit .vtxinwit .append (CTxInWitness ())
1406
1407
tx2 .wit .vtxinwit [0 ].scriptWitness .stack = [witness_program ]
1407
1408
tx2 .rehash ()
1408
- # Gets accepted to test_node, because standardness of outputs isn't
1409
- # checked with fRequireStandard
1409
+ # Gets accepted to both policy-enforcing nodes and others.
1410
1410
test_transaction_acceptance (self .nodes [0 ], self .test_node , tx2 , with_witness = True , accepted = True )
1411
- test_transaction_acceptance (self .nodes [1 ], self .std_node , tx2 , with_witness = True , accepted = False )
1411
+ test_transaction_acceptance (self .nodes [1 ], self .std_node , tx2 , with_witness = True , accepted = True )
1412
1412
temp_utxo .pop () # last entry in temp_utxo was the output we just spent
1413
1413
temp_utxo .append (UTXO (tx2 .sha256 , 0 , tx2 .vout [0 ].nValue ))
1414
1414
0 commit comments