Skip to content

Commit c3038bf

Browse files
committed
Merge bitcoin/bitcoin#29076: fuzz: set m_fallback_fee and m_fee_mode in wallet_fees target
e03d6f7 fuzz: set `m_fallback_fee`/`m_fee_mode` in `wallet_fees` target (brunoerg) Pull request description: `m_fallback_fee` and `m_fee_mode` are used in `GetMinimumFeeRate` but we're not setting any value for them in `wallet_fees` target. That's the reason fuzzing is never reaching the following code: ![Screenshot 2023-12-13 at 15 04 30](https://github.com/bitcoin/bitcoin/assets/19480819/454ddcaa-75ca-452f-ad13-5f142de0bdce) This PR fixes it. ACKs for top commit: maflcko: review ACK e03d6f7 achow101: ACK e03d6f7 murchandamus: ACK e03d6f7 Tree-SHA512: 5d364f5351d65762a3ddf88e3abb7bda401b7e4955285e083031d216fb50082b1ea98e2c065aff75a5a8a3d1bc4c2e5e3ca9f9478d902ee8f8d4347b6cbe53af
2 parents 00bf4a1 + e03d6f7 commit c3038bf

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/wallet/test/fuzz/fees.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ FUZZ_TARGET(wallet_fees, .init = initialize_setup)
3636
wallet.SetLastBlockProcessed(chainstate->m_chain.Height(), chainstate->m_chain.Tip()->GetBlockHash());
3737
}
3838

39+
if (fuzzed_data_provider.ConsumeBool()) {
40+
wallet.m_fallback_fee = CFeeRate{ConsumeMoney(fuzzed_data_provider, /*max=*/COIN)};
41+
}
42+
3943
if (fuzzed_data_provider.ConsumeBool()) {
4044
wallet.m_discard_rate = CFeeRate{ConsumeMoney(fuzzed_data_provider, /*max=*/COIN)};
4145
}
@@ -58,6 +62,9 @@ FUZZ_TARGET(wallet_fees, .init = initialize_setup)
5862
if (fuzzed_data_provider.ConsumeBool()) {
5963
coin_control.m_confirm_target = fuzzed_data_provider.ConsumeIntegralInRange<unsigned int>(0, 999'000);
6064
}
65+
if (fuzzed_data_provider.ConsumeBool()) {
66+
coin_control.m_fee_mode = fuzzed_data_provider.ConsumeBool() ? FeeEstimateMode::CONSERVATIVE : FeeEstimateMode::ECONOMICAL;
67+
}
6168

6269
FeeCalculation fee_calculation;
6370
FeeCalculation* maybe_fee_calculation{fuzzed_data_provider.ConsumeBool() ? nullptr : &fee_calculation};

0 commit comments

Comments
 (0)