From fa5591d38cfc917235a3dffd61c36dbf1f781a4d Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Thu, 22 Apr 2021 13:57:12 +0200 Subject: [PATCH] test: Hide tx rehash in helper This avoids code-bloat and accidentally forgetting to call it --- test/functional/feature_cltv.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/functional/feature_cltv.py b/test/functional/feature_cltv.py index 5c4512c387..49dea28c4e 100755 --- a/test/functional/feature_cltv.py +++ b/test/functional/feature_cltv.py @@ -51,6 +51,7 @@ def cltv_modify_tx(node, tx, prepend_scriptsig, nsequence=None, nlocktime=None): tx.deserialize(BytesIO(hex_str_to_bytes(signed_result['hex']))) tx.vin[0].scriptSig = CScript(prepend_scriptsig + list(CScript(tx.vin[0].scriptSig))) + tx.rehash() return tx @@ -124,7 +125,6 @@ class BIP65Test(BitcoinTestFramework): spendtx = create_transaction(self.nodes[0], self.coinbase_txids[i], self.nodeaddress, amount=1.0) spendtx = cltv_invalidate(self.nodes[0], spendtx, i) - spendtx.rehash() invalid_ctlv_txs.append(spendtx) tip = self.nodes[0].getbestblockhash() @@ -161,7 +161,6 @@ class BIP65Test(BitcoinTestFramework): spendtx = create_transaction(self.nodes[0], self.coinbase_txids[10+i], self.nodeaddress, amount=1.0) spendtx = cltv_invalidate(self.nodes[0], spendtx, i) - spendtx.rehash() expected_cltv_reject_reason = [ "non-mandatory-script-verify-flag (Operation not valid with the current stack size)", @@ -195,7 +194,6 @@ class BIP65Test(BitcoinTestFramework): self.log.info("Test that a version 4 block with a valid-according-to-CLTV transaction is accepted") spendtx = cltv_validate(self.nodes[0], spendtx, CLTV_HEIGHT - 1) - spendtx.rehash() block.vtx.pop(1) block.vtx.append(spendtx)