You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[refactor]: update coin selection algorithms input parameter max_weight name
- This commit renames the coin selection algorithms input parameter `max_weight`
to `max_selection_weight` for clarity.
The parameter represent the maximum weight of the UTXOs the coin selection algorithm
should select, not the transaction maximum weight.
- The commit updates the parameter docstring to provide correct description.
- Also updates coin selection unit and fuzzing test variables to match the new name.
curr_value > selection_target + cost_of_change || // Selected value is out of range, go back and try other branch
129
129
(curr_waste > best_waste && is_feerate_high)) { // Don't select things which we know will be more wasteful if the waste is increasing
130
130
backtrack = true;
131
-
} elseif (curr_selection_weight > max_weight) { //Exceeding weight for standard tx, cannot find more solutions by adding more inputs
131
+
} elseif (curr_selection_weight > max_selection_weight) { //Selected UTXOs weight exceeds the maximum weight allowed, cannot find more solutions by adding more inputs
132
132
max_tx_weight_exceeded = true; // at least one selection attempt exceeded the max weight
133
133
backtrack = true;
134
134
} elseif (curr_value >= selection_target) { // Selected value is within range
// The knapsack solver has some legacy behavior where it will spend dust outputs. We retain this behavior, so don't filter for positive only here.
712
-
if (auto knapsack_result{KnapsackSolver(groups.mixed_group, nTargetValue, coin_selection_params.m_min_change_target, coin_selection_params.rng_fast, max_inputs_weight)}) {
712
+
if (auto knapsack_result{KnapsackSolver(groups.mixed_group, nTargetValue, coin_selection_params.m_min_change_target, coin_selection_params.rng_fast, max_selection_weight)}) {
713
713
results.push_back(*knapsack_result);
714
714
} elseappend_error(std::move(knapsack_result));
715
715
716
716
if (coin_selection_params.m_effective_feerate > CFeeRate{3 * coin_selection_params.m_long_term_feerate}) { // Minimize input set for feerates of at least 3×LTFRE (default: 30 ṩ/vB+)
717
-
if (auto cg_result{CoinGrinder(groups.positive_group, nTargetValue, coin_selection_params.m_min_change_target, max_inputs_weight)}) {
717
+
if (auto cg_result{CoinGrinder(groups.positive_group, nTargetValue, coin_selection_params.m_min_change_target, max_selection_weight)}) {
0 commit comments