@@ -51,12 +51,13 @@ def run_test(self):
51
51
print ("Running test BIP68 not consensus before versionbits activation" )
52
52
self .test_bip68_not_consensus ()
53
53
54
- print ("Verifying nVersion=2 transactions are standard" )
55
- self .test_version2_relay ()
56
-
57
54
print ("Activating BIP68 (and 112/113)" )
58
55
self .activateCSV ()
59
56
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
+
60
61
print ("Passed\n " )
61
62
62
63
# Test that BIP68 is not in effect if tx version is 1, or if
@@ -396,7 +397,16 @@ def test_bip68_not_consensus(self):
396
397
self .nodes [0 ].submitblock (ToHex (block ))
397
398
assert_equal (self .nodes [0 ].getbestblockhash (), block .hash )
398
399
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.
400
410
def test_version2_relay (self ):
401
411
inputs = [ ]
402
412
outputs = { self .nodes [1 ].getnewaddress () : 1.0 }
@@ -407,14 +417,5 @@ def test_version2_relay(self):
407
417
tx_signed = self .nodes [1 ].signrawtransaction (ToHex (tx ))["hex" ]
408
418
tx_id = self .nodes [1 ].sendrawtransaction (tx_signed )
409
419
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
-
419
420
if __name__ == '__main__' :
420
421
BIP68Test ().main ()
0 commit comments