Skip to content

Commit fa5591d

Browse files
author
MarcoFalke
committed
test: Hide tx rehash in helper
This avoids code-bloat and accidentally forgetting to call it
1 parent fa5f938 commit fa5591d

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

test/functional/feature_cltv.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ def cltv_modify_tx(node, tx, prepend_scriptsig, nsequence=None, nlocktime=None):
5151
tx.deserialize(BytesIO(hex_str_to_bytes(signed_result['hex'])))
5252

5353
tx.vin[0].scriptSig = CScript(prepend_scriptsig + list(CScript(tx.vin[0].scriptSig)))
54+
tx.rehash()
5455
return tx
5556

5657

@@ -124,7 +125,6 @@ def run_test(self):
124125
spendtx = create_transaction(self.nodes[0], self.coinbase_txids[i],
125126
self.nodeaddress, amount=1.0)
126127
spendtx = cltv_invalidate(self.nodes[0], spendtx, i)
127-
spendtx.rehash()
128128
invalid_ctlv_txs.append(spendtx)
129129

130130
tip = self.nodes[0].getbestblockhash()
@@ -161,7 +161,6 @@ def run_test(self):
161161
spendtx = create_transaction(self.nodes[0], self.coinbase_txids[10+i],
162162
self.nodeaddress, amount=1.0)
163163
spendtx = cltv_invalidate(self.nodes[0], spendtx, i)
164-
spendtx.rehash()
165164

166165
expected_cltv_reject_reason = [
167166
"non-mandatory-script-verify-flag (Operation not valid with the current stack size)",
@@ -195,7 +194,6 @@ def run_test(self):
195194

196195
self.log.info("Test that a version 4 block with a valid-according-to-CLTV transaction is accepted")
197196
spendtx = cltv_validate(self.nodes[0], spendtx, CLTV_HEIGHT - 1)
198-
spendtx.rehash()
199197

200198
block.vtx.pop(1)
201199
block.vtx.append(spendtx)

0 commit comments

Comments
 (0)