@@ -1357,7 +1357,8 @@ def test_tx_relay_after_segwit_activation(self):
13571357 def test_segwit_versions (self ):
13581358 """Test validity of future segwit version transactions.
13591359
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.
13611362 Can run this before and after segwit activation."""
13621363
13631364 NUM_SEGWIT_VERSIONS = 17 # will test OP_0, OP1, ..., OP_16
@@ -1397,18 +1398,17 @@ def test_segwit_versions(self):
13971398 assert len (self .nodes [0 ].getrawmempool ()) == 0
13981399
13991400 # Finally, verify that version 0 -> version 1 transactions
1400- # are non- standard
1401+ # are standard
14011402 script_pubkey = CScript ([CScriptOp (OP_1 ), witness_hash ])
14021403 tx2 = CTransaction ()
14031404 tx2 .vin = [CTxIn (COutPoint (tx .sha256 , 0 ), b"" )]
14041405 tx2 .vout = [CTxOut (tx .vout [0 ].nValue - 1000 , script_pubkey )]
14051406 tx2 .wit .vtxinwit .append (CTxInWitness ())
14061407 tx2 .wit .vtxinwit [0 ].scriptWitness .stack = [witness_program ]
14071408 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.
14101410 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 )
14121412 temp_utxo .pop () # last entry in temp_utxo was the output we just spent
14131413 temp_utxo .append (UTXO (tx2 .sha256 , 0 , tx2 .vout [0 ].nValue ))
14141414
0 commit comments