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:
Murch committed 2023-09-13 15:46:59 -04:00
1 parent 2e35e944da
commit f18f9ef4d3
8 files changed
+88 -21

No files matched your search

+10
View File
@@ -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());
}
}