@@ -51,12 +51,13 @@ def run_test(self):
5151 print ("Running test BIP68 not consensus before versionbits activation" )
5252 self .test_bip68_not_consensus ()
5353
54- print ("Verifying nVersion=2 transactions are standard" )
55- self .test_version2_relay ()
56-
5754 print ("Activating BIP68 (and 112/113)" )
5855 self .activateCSV ()
5956
57+ print ("Verifying nVersion=2 transactions are standard." )
58+ print ("Note that with current versions of bitcoin software, nVersion=2 transactions are always standard (independent of BIP68 activation status)." )
59+ self .test_version2_relay ()
60+
6061 print ("Passed\n " )
6162
6263 # Test that BIP68 is not in effect if tx version is 1, or if
@@ -396,7 +397,16 @@ def test_bip68_not_consensus(self):
396397 self .nodes [0 ].submitblock (ToHex (block ))
397398 assert_equal (self .nodes [0 ].getbestblockhash (), block .hash )
398399
399- # Use self.nodes[1] to test that version 2 transactions are standard even before BIP68 activation.
400+ def activateCSV (self ):
401+ # activation should happen at block height 432 (3 periods)
402+ min_activation_height = 432
403+ height = self .nodes [0 ].getblockcount ()
404+ assert (height < 432 )
405+ self .nodes [0 ].generate (432 - height )
406+ assert (get_bip9_status (self .nodes [0 ], 'csv' )['status' ] == 'active' )
407+ sync_blocks (self .nodes )
408+
409+ # Use self.nodes[1] to test that version 2 transactions are standard.
400410 def test_version2_relay (self ):
401411 inputs = [ ]
402412 outputs = { self .nodes [1 ].getnewaddress () : 1.0 }
@@ -407,14 +417,5 @@ def test_version2_relay(self):
407417 tx_signed = self .nodes [1 ].signrawtransaction (ToHex (tx ))["hex" ]
408418 tx_id = self .nodes [1 ].sendrawtransaction (tx_signed )
409419
410- def activateCSV (self ):
411- # activation should happen at block height 432 (3 periods)
412- min_activation_height = 432
413- height = self .nodes [0 ].getblockcount ()
414- assert (height < 432 )
415- self .nodes [0 ].generate (432 - height )
416- assert (get_bip9_status (self .nodes [0 ], 'csv' )['status' ] == 'active' )
417- sync_blocks (self .nodes )
418-
419420if __name__ == '__main__' :
420421 BIP68Test ().main ()
0 commit comments