Skip to content

Commit

Permalink
Refactor ComputeAndSetWaste()
Browse files Browse the repository at this point in the history
  • Loading branch information
murchandamus committed May 24, 2024
1 parent 4c387cb commit d186c64
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/wallet/coinselection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -842,13 +842,8 @@ void SelectionResult::SetBumpFeeDiscount(const CAmount discount)

void SelectionResult::ComputeAndSetWaste(const CAmount min_viable_change, const CAmount change_cost, const CAmount change_fee)
{
const CAmount change = GetChange(min_viable_change, change_fee);

if (change > 0) {
m_waste = GetSelectionWaste(change_cost, m_target, m_use_effective);
} else {
m_waste = GetSelectionWaste(0, m_target, m_use_effective);
}
bool makes_change = {GetChange(min_viable_change, change_fee) != 0};
m_waste = GetSelectionWaste(makes_change ? change_cost : 0, m_target, m_use_effective);
}

void SelectionResult::SetAlgoCompleted(bool algo_completed)
Expand Down

0 comments on commit d186c64

Please sign in to comment.