aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAndrew Chow <github@achow101.com>2022-12-07 00:03:26 -0500
committerAndrew Chow <github@achow101.com>2022-12-09 13:57:01 -0500
commit6c872d5e656a7117bbdf19a0220572b93de16f31 (patch)
treec37b7dca6b023436023f8c205a2c861642facec8 /test
parent544cbf776cf25d90ea4b96d92e7ee6e316576038 (diff)
downloadbitcoin-6c872d5e656a7117bbdf19a0220572b93de16f31.tar.xz
tests: Initialize sigops draining script with bytes in feature_taproot
The sigops draining script in feature_taproot's block_submit was initialized with a list that would end up always being iterated by CScript's constructor. Since this list is very large, a lot of time would be wasted. By creating and passing a bytes object initialized from that list, we can avoid this iteration and dramatically improve the runtime of feature_taproot.
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/feature_taproot.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/functional/feature_taproot.py b/test/functional/feature_taproot.py
index dbe51f8f54..f6f6f3f78b 100755
--- a/test/functional/feature_taproot.py
+++ b/test/functional/feature_taproot.py
@@ -1292,7 +1292,7 @@ class TaprootTest(BitcoinTestFramework):
# It is not impossible to fit enough tapscript sigops to hit the old 80k limit without
# busting txin-level limits. We simply have to account for the p2pk outputs in all
# transactions.
- extra_output_script = CScript([OP_CHECKSIG]*((MAX_BLOCK_SIGOPS_WEIGHT - sigops_weight) // WITNESS_SCALE_FACTOR))
+ extra_output_script = CScript(bytes([OP_CHECKSIG]*((MAX_BLOCK_SIGOPS_WEIGHT - sigops_weight) // WITNESS_SCALE_FACTOR)))
coinbase_tx = create_coinbase(self.lastblockheight + 1, pubkey=cb_pubkey, extra_output_script=extra_output_script, fees=fees)
block = create_block(self.tip, coinbase_tx, self.lastblocktime + 1, txlist=txs)