mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 10:43:19 -03:00
fuzz: Properly initialize PrecomputedTransactionData
This commit is contained in:
parent
d67883d01e
commit
fa56d56d4e
1 changed files with 7 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue