mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
Amend bumpfee for inputs with overlapping ancestry
At the end of coin selection reduce the fees by the difference between the individual bump fee estimates and the collective bump fee estimate.
This commit is contained in:
@@ -977,6 +977,11 @@ BOOST_AUTO_TEST_CASE(bump_fee_test)
|
||||
selection.ComputeAndSetWaste(min_viable_change, change_cost, change_fee);
|
||||
CAmount expected_waste = fee_diff * -2 + change_cost + /*bump_fees=*/60;
|
||||
BOOST_CHECK_EQUAL(expected_waste, selection.GetWaste());
|
||||
|
||||
selection.SetBumpFeeDiscount(30);
|
||||
selection.ComputeAndSetWaste(min_viable_change, change_cost, change_fee);
|
||||
expected_waste = fee_diff * -2 + change_cost + /*bump_fees=*/60 - /*group_discount=*/30;
|
||||
BOOST_CHECK_EQUAL(expected_waste, selection.GetWaste());
|
||||
}
|
||||
|
||||
{
|
||||
@@ -998,6 +1003,11 @@ BOOST_AUTO_TEST_CASE(bump_fee_test)
|
||||
selection.ComputeAndSetWaste(min_viable_change, change_cost, change_fee);
|
||||
CAmount expected_waste = fee_diff * -2 + /*bump_fees=*/60 + /*excess = 100 - bump_fees*/40;
|
||||
BOOST_CHECK_EQUAL(expected_waste, selection.GetWaste());
|
||||
|
||||
selection.SetBumpFeeDiscount(30);
|
||||
selection.ComputeAndSetWaste(min_viable_change, change_cost, change_fee);
|
||||
expected_waste = fee_diff * -2 + /*bump_fees=*/60 - /*group_discount=*/30 + /*excess = 100 - bump_fees + group_discount*/70;
|
||||
BOOST_CHECK_EQUAL(expected_waste, selection.GetWaste());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user