aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2020-10-26 09:28:11 +0100
committerMarcoFalke <falke.marco@gmail.com>2020-10-26 09:17:25 +0100
commitfa56d56d4e9b69fdd02e631b9a2380cfd3095144 (patch)
tree8b0025a06b2d2138c7f47c972c456dc034f7c062 /src/test
parentd67883d01e507dd22d1281f4a4860e79d6a46a47 (diff)
fuzz: Properly initialize PrecomputedTransactionData
Diffstat (limited to 'src/test')
-rw-r--r--src/test/fuzz/script_flags.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/test/fuzz/script_flags.cpp b/src/test/fuzz/script_flags.cpp
index ffc65eedc0..300c78fca0 100644
--- a/src/test/fuzz/script_flags.cpp
+++ b/src/test/fuzz/script_flags.cpp
@@ -31,7 +31,6 @@ void test_one_input(const std::vector<uint8_t>& buffer)
try {
const CTransaction tx(deserialize, ds);
- const PrecomputedTransactionData txdata(tx);
unsigned int verify_flags;
ds >> verify_flags;
@@ -41,10 +40,17 @@ void test_one_input(const std::vector<uint8_t>& buffer)
unsigned int fuzzed_flags;
ds >> fuzzed_flags;
+ std::vector<CTxOut> spent_outputs;
for (unsigned i = 0; i < tx.vin.size(); ++i) {
CTxOut prevout;
ds >> prevout;
+ spent_outputs.push_back(prevout);
+ }
+ PrecomputedTransactionData txdata;
+ txdata.Init(tx, std::move(spent_outputs));
+ for (unsigned i = 0; i < tx.vin.size(); ++i) {
+ const CTxOut& prevout = txdata.m_spent_outputs.at(i);
const TransactionSignatureChecker checker{&tx, i, prevout.nValue, txdata};
ScriptError serror;