Skip to content

Commit

Permalink
[fuzz] Avoid partial negative result
Browse files Browse the repository at this point in the history
  • Loading branch information
murchandamus committed Feb 21, 2024
1 parent 88b1229 commit 9dae3b9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/wallet/test/fuzz/coinselection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ FUZZ_TARGET(coin_grinder_is_optimal)
// Only make UTXOs with positive effective value
const CAmount input_fee = coin_params.m_effective_feerate.GetFee(n_input_bytes);
// Ensure that each UTXO has at least an effective value of 1 sat
const CAmount eff_value{fuzzed_data_provider.ConsumeIntegralInRange<CAmount>(1, MAX_MONEY - max_spendable - max_output_groups + group_pos.size())};
const CAmount eff_value{fuzzed_data_provider.ConsumeIntegralInRange<CAmount>(1, MAX_MONEY + group_pos.size() - max_spendable - max_output_groups)};
const CAmount amount{eff_value + input_fee};
std::vector<COutput> temp_utxo_pool;

Expand Down

0 comments on commit 9dae3b9

Please sign in to comment.