0diff --git a/src/test/fuzz/script_assets_test_minimizer.cpp b/src/test/fuzz/script_assets_test_minimizer.cpp
1index 511b581f606..7478897e170 100644
2--- a/src/test/fuzz/script_assets_test_minimizer.cpp
3+++ b/src/test/fuzz/script_assets_test_minimizer.cpp
4@@ -7,6 +7,7 @@
5 #include <primitives/transaction.h>
6 #include <pubkey.h>
7 #include <script/interpreter.h>
8+#include <script/txhash.h>
9 #include <serialize.h>
10 #include <streams.h>
11 #include <univalue.h>
12@@ -159,7 +160,8 @@ void Test(const std::string& str)
13 tx.vin[idx].scriptWitness = ScriptWitnessFromJSON(test["success"]["witness"]);
14 PrecomputedTransactionData txdata;
15 txdata.Init(tx, std::vector<CTxOut>(prevouts));
16- MutableTransactionSignatureChecker txcheck(&tx, idx, prevouts[idx].nValue, txdata, MissingDataBehavior::ASSERT_FAIL);
17+ TxHashCache txhash_cache;
18+ MutableTransactionSignatureChecker txcheck(&tx, idx, prevouts[idx].nValue, txdata, &txhash_cache, MissingDataBehavior::ASSERT_FAIL);
19 for (const auto flags : ALL_FLAGS) {
20 // "final": true tests are valid for all flags. Others are only valid with flags that are
21 // a subset of test_flags.
22@@ -174,7 +176,8 @@ void Test(const std::string& str)
23 tx.vin[idx].scriptWitness = ScriptWitnessFromJSON(test["failure"]["witness"]);
24 PrecomputedTransactionData txdata;
25 txdata.Init(tx, std::vector<CTxOut>(prevouts));
26- MutableTransactionSignatureChecker txcheck(&tx, idx, prevouts[idx].nValue, txdata, MissingDataBehavior::ASSERT_FAIL);
27+ TxHashCache txhash_cache;
28+ MutableTransactionSignatureChecker txcheck(&tx, idx, prevouts[idx].nValue, txdata, &txhash_cache, MissingDataBehavior::ASSERT_FAIL);
29 for (const auto flags : ALL_FLAGS) {
30 // If a test is supposed to fail with test_flags, it should also fail with any superset thereof.
31 if ((flags & test_flags) == test_flags) {
32diff --git a/src/test/fuzz/script_flags.cpp b/src/test/fuzz/script_flags.cpp
33index accb32f1cc4..d9001fd81a0 100644
34--- a/src/test/fuzz/script_flags.cpp
35+++ b/src/test/fuzz/script_flags.cpp
36@@ -5,6 +5,7 @@
37 #include <consensus/amount.h>
38 #include <primitives/transaction.h>
39 #include <script/interpreter.h>
40+#include <script/txhash.h>
41 #include <serialize.h>
42 #include <streams.h>
43 #include <test/fuzz/fuzz.h>
44@@ -42,10 +43,11 @@ FUZZ_TARGET(script_flags)
45 }
46 PrecomputedTransactionData txdata;
47 txdata.Init(tx, std::move(spent_outputs));
48+ TxHashCache txhash_cache;
49
50 for (unsigned i = 0; i < tx.vin.size(); ++i) {
51 const CTxOut& prevout = txdata.m_spent_outputs.at(i);
52- const TransactionSignatureChecker checker{&tx, i, prevout.nValue, txdata, MissingDataBehavior::ASSERT_FAIL};
53+ const TransactionSignatureChecker checker{&tx, i, prevout.nValue, txdata, &txhash_cache, MissingDataBehavior::ASSERT_FAIL};
54
55 ScriptError serror;
56 const bool ret = VerifyScript(tx.vin.at(i).scriptSig, prevout.scriptPubKey, &tx.vin.at(i).scriptWitness, verify_flags, checker, &serror);
57diff --git a/src/test/fuzz/script_sigcache.cpp b/src/test/fuzz/script_sigcache.cpp
58index 5fdbc9e1069..9cc233fed19 100644
59--- a/src/test/fuzz/script_sigcache.cpp
60+++ b/src/test/fuzz/script_sigcache.cpp
61@@ -6,6 +6,7 @@
62 #include <key.h>
63 #include <pubkey.h>
64 #include <script/sigcache.h>
65+#include <script/txhash.h>
66 #include <test/fuzz/FuzzedDataProvider.h>
67 #include <test/fuzz/fuzz.h>
68 #include <test/fuzz/util.h>
69@@ -36,7 +37,8 @@ FUZZ_TARGET(script_sigcache, .init = initialize_script_sigcache)
70 const CAmount amount = ConsumeMoney(fuzzed_data_provider);
71 const bool store = fuzzed_data_provider.ConsumeBool();
72 PrecomputedTransactionData tx_data;
73- CachingTransactionSignatureChecker caching_transaction_signature_checker{mutable_transaction ? &tx : nullptr, n_in, amount, store, tx_data};
74+ TxHashCache txhash_cache;
75+ CachingTransactionSignatureChecker caching_transaction_signature_checker{mutable_transaction ? &tx : nullptr, n_in, amount, store, tx_data, &txhash_cache};
76 if (fuzzed_data_provider.ConsumeBool()) {
77 const auto random_bytes = fuzzed_data_provider.ConsumeBytes<unsigned char>(64);
78 const XOnlyPubKey pub_key(ConsumeUInt256(fuzzed_data_provider));