@@ -1251,7 +1251,7 @@ def run_test(self):
1251
1251
blocks = []
1252
1252
spend = out [32 ]
1253
1253
for i in range (89 , LARGE_REORG_SIZE + 89 ):
1254
- b = self .next_block (i , spend , version = 4 )
1254
+ b = self .next_block (i , spend )
1255
1255
tx = CTransaction ()
1256
1256
script_length = MAX_BLOCK_BASE_SIZE - len (b .serialize ()) - 69
1257
1257
script_output = CScript ([b'\x00 ' * script_length ])
@@ -1270,26 +1270,26 @@ def run_test(self):
1270
1270
self .move_tip (88 )
1271
1271
blocks2 = []
1272
1272
for i in range (89 , LARGE_REORG_SIZE + 89 ):
1273
- blocks2 .append (self .next_block ("alt" + str (i ), version = 4 ))
1273
+ blocks2 .append (self .next_block ("alt" + str (i )))
1274
1274
self .send_blocks (blocks2 , False , force_send = True )
1275
1275
1276
1276
# extend alt chain to trigger re-org
1277
- block = self .next_block ("alt" + str (chain1_tip + 1 ), version = 4 )
1277
+ block = self .next_block ("alt" + str (chain1_tip + 1 ))
1278
1278
self .send_blocks ([block ], True , timeout = 2440 )
1279
1279
1280
1280
# ... and re-org back to the first chain
1281
1281
self .move_tip (chain1_tip )
1282
- block = self .next_block (chain1_tip + 1 , version = 4 )
1282
+ block = self .next_block (chain1_tip + 1 )
1283
1283
self .send_blocks ([block ], False , force_send = True )
1284
- block = self .next_block (chain1_tip + 2 , version = 4 )
1284
+ block = self .next_block (chain1_tip + 2 )
1285
1285
self .send_blocks ([block ], True , timeout = 2440 )
1286
1286
1287
1287
self .log .info ("Reject a block with an invalid block header version" )
1288
1288
b_v1 = self .next_block ('b_v1' , version = 1 )
1289
1289
self .send_blocks ([b_v1 ], success = False , force_send = True , reject_reason = 'bad-version(0x00000001)' , reconnect = True )
1290
1290
1291
1291
self .move_tip (chain1_tip + 2 )
1292
- b_cb34 = self .next_block ('b_cb34' , version = 4 )
1292
+ b_cb34 = self .next_block ('b_cb34' )
1293
1293
b_cb34 .vtx [0 ].vin [0 ].scriptSig = b_cb34 .vtx [0 ].vin [0 ].scriptSig [:- 1 ]
1294
1294
b_cb34 .vtx [0 ].rehash ()
1295
1295
b_cb34 .hashMerkleRoot = b_cb34 .calc_merkle_root ()
@@ -1323,7 +1323,7 @@ def create_and_sign_transaction(self, spend_tx, value, script=CScript([OP_TRUE])
1323
1323
tx .rehash ()
1324
1324
return tx
1325
1325
1326
- def next_block (self , number , spend = None , additional_coinbase_value = 0 , script = CScript ([OP_TRUE ]), * , version = 1 ):
1326
+ def next_block (self , number , spend = None , additional_coinbase_value = 0 , script = CScript ([OP_TRUE ]), * , version = 4 ):
1327
1327
if self .tip is None :
1328
1328
base_block_hash = self .genesis_hash
1329
1329
block_time = int (time .time ()) + 1
0 commit comments