diff options
author | Andrew Chow <github@achow101.com> | 2022-12-07 00:03:26 -0500 |
---|---|---|
committer | Andrew Chow <github@achow101.com> | 2022-12-09 13:57:01 -0500 |
commit | 6c872d5e656a7117bbdf19a0220572b93de16f31 (patch) | |
tree | c37b7dca6b023436023f8c205a2c861642facec8 | |
parent | 544cbf776cf25d90ea4b96d92e7ee6e316576038 (diff) | |
download | bitcoin-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.
-rwxr-xr-x | test/functional/feature_taproot.py | 2 |
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) |