mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 10:43:19 -03:00
fuzz: Add missing CheckTransaction before CheckTxInputs
This commit is contained in:
parent
faacb7eadb
commit
fae4ee545a
1 changed files with 6 additions and 0 deletions
|
@ -6,6 +6,7 @@
|
|||
#include <chainparams.h>
|
||||
#include <chainparamsbase.h>
|
||||
#include <coins.h>
|
||||
#include <consensus/tx_check.h>
|
||||
#include <consensus/tx_verify.h>
|
||||
#include <consensus/validation.h>
|
||||
#include <key.h>
|
||||
|
@ -230,6 +231,11 @@ FUZZ_TARGET_INIT(coins_view, initialize_coins_view)
|
|||
// consensus/tx_verify.cpp:171: bool Consensus::CheckTxInputs(const CTransaction &, TxValidationState &, const CCoinsViewCache &, int, CAmount &): Assertion `!coin.IsSpent()' failed.
|
||||
return;
|
||||
}
|
||||
TxValidationState dummy;
|
||||
if (!CheckTransaction(transaction, dummy)) {
|
||||
// It is not allowed to call CheckTxInputs if CheckTransaction failed
|
||||
return;
|
||||
}
|
||||
(void)Consensus::CheckTxInputs(transaction, state, coins_view_cache, fuzzed_data_provider.ConsumeIntegralInRange<int>(0, std::numeric_limits<int>::max()), tx_fee_out);
|
||||
assert(MoneyRange(tx_fee_out));
|
||||
},
|
||||
|
|
Loading…
Add table
Reference in a new issue