Skip to content

Commit 9dae3b9

Browse files
committed
[fuzz] Avoid partial negative result
1 parent 88b1229 commit 9dae3b9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/wallet/test/fuzz/coinselection.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ FUZZ_TARGET(coin_grinder_is_optimal)
158158
// Only make UTXOs with positive effective value
159159
const CAmount input_fee = coin_params.m_effective_feerate.GetFee(n_input_bytes);
160160
// Ensure that each UTXO has at least an effective value of 1 sat
161-
const CAmount eff_value{fuzzed_data_provider.ConsumeIntegralInRange<CAmount>(1, MAX_MONEY - max_spendable - max_output_groups + group_pos.size())};
161+
const CAmount eff_value{fuzzed_data_provider.ConsumeIntegralInRange<CAmount>(1, MAX_MONEY + group_pos.size() - max_spendable - max_output_groups)};
162162
const CAmount amount{eff_value + input_fee};
163163
std::vector<COutput> temp_utxo_pool;
164164

0 commit comments

Comments
 (0)