diff --git a/src/consensus/tx_verify.h b/src/consensus/tx_verify.h index f0216db6c4..5094dc9eb8 100644 --- a/src/consensus/tx_verify.h +++ b/src/consensus/tx_verify.h @@ -28,7 +28,7 @@ namespace Consensus { * @param[out] fee_map Set to the transaction fee if successful. * Preconditions: tx.IsCoinBase() is false. */ -bool CheckTxInputs(const CTransaction& tx, TxValidationState& state, const CCoinsViewCache& inputs, int nSpendHeight, CAmountMap& fee_map, std::set>& setPeginsSpent, std::vector *pvChecks, const bool cacheStore, bool fScriptChecks, const std::vector>& fedpegscripts); +[[nodiscard] ]bool CheckTxInputs(const CTransaction& tx, TxValidationState& state, const CCoinsViewCache& inputs, int nSpendHeight, CAmountMap& fee_map, std::set>& setPeginsSpent, std::vector *pvChecks, const bool cacheStore, bool fScriptChecks, const std::vector>& fedpegscripts); } // namespace Consensus /** Auxiliary functions for transaction validation (ideally should not be exposed) */ diff --git a/src/test/fuzz/coins_view.cpp b/src/test/fuzz/coins_view.cpp index 8206bcb215..3eb08cdc98 100644 --- a/src/test/fuzz/coins_view.cpp +++ b/src/test/fuzz/coins_view.cpp @@ -247,8 +247,9 @@ FUZZ_TARGET_INIT(coins_view, initialize_coins_view) } std::vector> fedpegscripts; // ELEMENTS: we ought to populate this and have a more useful fuzztest std::set > setPeginsSpent; - (void)Consensus::CheckTxInputs(transaction, state, coins_view_cache, fuzzed_data_provider.ConsumeIntegralInRange(0, std::numeric_limits::max()), tx_fee_map, setPeginsSpent, NULL, false, true, fedpegscripts); - assert(MoneyRange(tx_fee_map)); + if (Consensus::CheckTxInputs(transaction, state, coins_view_cache, fuzzed_data_provider.ConsumeIntegralInRange(0, std::numeric_limits::max()), tx_fee_map, setPeginsSpent, NULL, false, true, fedpegscripts)) { + assert(MoneyRange(tx_fee_map)); + } }, [&] { const CTransaction transaction{random_mutable_transaction};