mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-13 03:30:42 +02:00
Merge bitcoin/bitcoin#31806: fuzz: coinselection: cover SetBumpFeeDiscount
0ff66b1c4a
fuzz: coinselection: cover `SetBumpFeeDiscount` (brunoerg) Pull request description: `SetBumpFeeDiscount` sets the bump fee discount which is used to calculate the waste. We currently have no fuzz coverage for this function, so this PR adds it by calling `SetBumpFeeDiscount` before `RecalculateWaste`. ACKs for top commit: marcofleon: ACK0ff66b1c4a
Tree-SHA512: d5c1d97daaeb7f9b096bf9bdf6374b8a674a75f464e2b9bb3e1e1774a5805b22840ca1f31bae63f106640d9ce27a99432c3034524340be91c235f6ec3b185cff
This commit is contained in:
commit
c8ade107c8
@ -282,6 +282,7 @@ void FuzzCoinSelectionAlgorithm(std::span<const uint8_t> buffer) {
|
||||
assert(result_srd->GetSelectedValue() >= target);
|
||||
assert(result_srd->GetChange(CHANGE_LOWER, coin_params.m_change_fee) > 0);
|
||||
assert(result_srd->GetWeight() <= max_selection_weight);
|
||||
result_srd->SetBumpFeeDiscount(ConsumeMoney(fuzzed_data_provider));
|
||||
result_srd->RecalculateWaste(coin_params.min_viable_change, coin_params.m_cost_of_change, coin_params.m_change_fee);
|
||||
(void)result_srd->GetShuffledInputVector();
|
||||
(void)result_srd->GetInputSet();
|
||||
@ -308,6 +309,7 @@ void FuzzCoinSelectionAlgorithm(std::span<const uint8_t> buffer) {
|
||||
result = *result_knapsack;
|
||||
assert(result_knapsack->GetSelectedValue() >= target);
|
||||
assert(result_knapsack->GetWeight() <= max_selection_weight);
|
||||
result_knapsack->SetBumpFeeDiscount(ConsumeMoney(fuzzed_data_provider));
|
||||
result_knapsack->RecalculateWaste(coin_params.min_viable_change, coin_params.m_cost_of_change, coin_params.m_change_fee);
|
||||
(void)result_knapsack->GetShuffledInputVector();
|
||||
(void)result_knapsack->GetInputSet();
|
||||
|
Loading…
Reference in New Issue
Block a user