minor suggestions: s/0 Waste/No waste/
, braced initialization for type safety, named args
0@@ -724,25 +724,25 @@ BOOST_AUTO_TEST_CASE(waste_test)
1 BOOST_CHECK_LT(waste_nochange2, waste_nochange1);
2 selection.clear();
3
4- // 0 Waste when fee == long term fee, no change, and no excess
5+ // No waste when fee == long term fee, no change, and no excess
6 add_coin(1 * COIN, 1, selection, fee, fee);
7 add_coin(2 * COIN, 2, selection, fee, fee);
8- const CAmount exact_target = in_amt - 2 * fee;
9- BOOST_CHECK_EQUAL(0, GetSelectionWaste(selection, 0, exact_target));
10+ const CAmount exact_target{in_amt - 2 * fee};
11+ BOOST_CHECK_EQUAL(0, GetSelectionWaste(selection, /* change_cost */ 0, exact_target));
12 selection.clear();
13
14- // 0 Waste when (long term fee - fee) == cost of change, and no excess
15- const CAmount new_change_cost = fee_diff * 2;
16+ // No waste when (long term fee - fee) == cost of change, and no excess
17+ const CAmount new_change_cost{fee_diff * 2};
18 add_coin(1 * COIN, 1, selection, fee, fee + fee_diff);
19 add_coin(2 * COIN, 2, selection, fee, fee + fee_diff);
20 BOOST_CHECK_EQUAL(0, GetSelectionWaste(selection, new_change_cost, target));
21 selection.clear();
22
23- // 0 Waste when (long term fee - fee) == excess, no change cost
24- const CAmount new_target = in_amt - fee * 2 - fee_diff * 2;
25+ // No waste when (long term fee - fee) == excess, no change cost
26+ const CAmount new_target{in_amt - fee * 2 - fee_diff * 2};
27 add_coin(1 * COIN, 1, selection, fee, fee + fee_diff);
28 add_coin(2 * COIN, 2, selection, fee, fee + fee_diff);
29- BOOST_CHECK_EQUAL(0, GetSelectionWaste(selection, 0, new_target));
30+ BOOST_CHECK_EQUAL(0, GetSelectionWaste(selection, /* change_cost */ 0, new_target));