@@ -120,13 +120,15 @@ def create_bip112special(self, input, txversion):
120120 tx .nVersion = txversion
121121 self .miniwallet .sign_tx (tx )
122122 tx .vin [0 ].scriptSig = CScript ([- 1 , OP_CHECKSEQUENCEVERIFY , OP_DROP ] + list (CScript (tx .vin [0 ].scriptSig )))
123+ tx .rehash ()
123124 return tx
124125
125126 def create_bip112emptystack (self , input , txversion ):
126127 tx = self .create_self_transfer_from_utxo (input )
127128 tx .nVersion = txversion
128129 self .miniwallet .sign_tx (tx )
129130 tx .vin [0 ].scriptSig = CScript ([OP_CHECKSEQUENCEVERIFY ] + list (CScript (tx .vin [0 ].scriptSig )))
131+ tx .rehash ()
130132 return tx
131133
132134 def send_generic_input_tx (self , coinbases ):
@@ -144,7 +146,6 @@ def create_bip68txs(self, bip68inputs, txversion, locktime_delta=0):
144146 tx .nVersion = txversion
145147 tx .vin [0 ].nSequence = locktime + locktime_delta
146148 self .miniwallet .sign_tx (tx )
147- tx .rehash ()
148149 txs .append ({'tx' : tx , 'sdf' : sdf , 'stf' : stf })
149150
150151 return txs
@@ -350,20 +351,16 @@ def run_test(self):
350351 # BIP 113 tests should now fail regardless of version number if nLockTime isn't satisfied by new rules
351352 bip113tx_v1 .nLockTime = self .last_block_time - 600 * 5 # = MTP of prior block (not <) but < time put on current block
352353 self .miniwallet .sign_tx (bip113tx_v1 )
353- bip113tx_v1 .rehash ()
354354 bip113tx_v2 .nLockTime = self .last_block_time - 600 * 5 # = MTP of prior block (not <) but < time put on current block
355355 self .miniwallet .sign_tx (bip113tx_v2 )
356- bip113tx_v2 .rehash ()
357356 for bip113tx in [bip113tx_v1 , bip113tx_v2 ]:
358357 self .send_blocks ([self .create_test_block ([bip113tx ])], success = False , reject_reason = 'bad-txns-nonfinal' )
359358
360359 # BIP 113 tests should now pass if the locktime is < MTP
361360 bip113tx_v1 .nLockTime = self .last_block_time - 600 * 5 - 1 # < MTP of prior block
362361 self .miniwallet .sign_tx (bip113tx_v1 )
363- bip113tx_v1 .rehash ()
364362 bip113tx_v2 .nLockTime = self .last_block_time - 600 * 5 - 1 # < MTP of prior block
365363 self .miniwallet .sign_tx (bip113tx_v2 )
366- bip113tx_v2 .rehash ()
367364 for bip113tx in [bip113tx_v1 , bip113tx_v2 ]:
368365 self .send_blocks ([self .create_test_block ([bip113tx ])])
369366 self .nodes [0 ].invalidateblock (self .nodes [0 ].getbestblockhash ())
@@ -488,7 +485,6 @@ def run_test(self):
488485 for tx in [tx ['tx' ] for tx in bip112txs_vary_OP_CSV_v2 if not tx ['sdf' ] and tx ['stf' ]]:
489486 tx .vin [0 ].nSequence = BASE_RELATIVE_LOCKTIME | SEQ_TYPE_FLAG
490487 self .miniwallet .sign_tx (tx )
491- tx .rehash ()
492488 time_txs .append (tx )
493489
494490 self .send_blocks ([self .create_test_block (time_txs )])
0 commit comments