fuzz: MockMempoolMinFee in wallet_fees
What changed, and why it matters
This commit only changes a fuzz test file used for automated testing of Bitcoin Core's wallet fee logic. It adds a helper that simulates a higher minimum mempool fee during the test so the fuzzer can exercise more code paths. There is no change to production wallet or mempool code, and no security issue is present in the diff.
No action required; this is a benign fuzz-test improvement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch modifies src/wallet/test/fuzz/fees.cpp to include test/util/txmempool.h and, after creating the mempool, optionally call MockMempoolMinFee() with a fuzzer-generated CFeeRate. This is purely a test-infrastructure change that broadens fuzz coverage by setting a synthetic mempool minimum fee when the generated feerate exceeds both incremental_relay_feerate and min_relay_feerate. No consensus, validation, wallet, or mempool runtime behavior is altered.
Changed components
src/wallet/test/fuzz/fees.cppInspect captured patch +6 / −0
diff --git a/src/wallet/test/fuzz/fees.cpp b/src/wallet/test/fuzz/fees.cpp
index 9cf7e89d..6d9de0cc 100644
--- a/src/wallet/test/fuzz/fees.cpp
+++ b/src/wallet/test/fuzz/fees.cpp
@@ -6,6 +6,7 @@
#include <test/fuzz/fuzz.h>
#include <test/fuzz/util.h>
#include <test/util/setup_common.h>
+#include <test/util/txmempool.h>
#include <validation.h>
#include <wallet/coincontrol.h>
#include <wallet/fees.h>
@@ -74,6 +75,11 @@ FUZZ_TARGET(wallet_fees, .init = initialize_setup)
node.mempool = std::make_unique<CTxMemPool>(mempool_opts, error);
std::unique_ptr<CBlockPolicyEstimator> fee_estimator = std::make_unique<FuzzedBlockPolicyEstimator>(fuzzed_data_provider);
g_setup->SetFeeEstimator(std::move(fee_estimator));
+ auto target_feerate{CFeeRate{ConsumeMoney(fuzzed_data_provider, /*max=*/1'000'000)}};
+ if (target_feerate > node.mempool->m_opts.incremental_relay_feerate &&
+ target_feerate > node.mempool->m_opts.min_relay_feerate) {
+ MockMempoolMinFee(target_feerate, *node.mempool);
+ }
std::unique_ptr<CWallet> wallet_ptr{std::make_unique<CWallet>(node.chain.get(), "", CreateMockableWalletDatabase())};
CWallet& wallet{*wallet_ptr};
{
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.