We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aaee658 commit 89d0956Copy full SHA for 89d0956
src/wallet/coinselection.cpp
@@ -25,10 +25,14 @@ static util::Result<SelectionResult> ErrorMaxWeightExceeded()
25
"Please try sending a smaller amount or manually consolidating your wallet's UTXOs")};
26
}
27
28
-// Descending order comparator
+// Sort by descending (effective) value prefer lower waste on tie
29
struct {
30
bool operator()(const OutputGroup& a, const OutputGroup& b) const
31
{
32
+ if (a.GetSelectionAmount() == b.GetSelectionAmount()) {
33
+ // Lower waste is better when effective_values are tied
34
+ return (a.fee - a.long_term_fee) < (b.fee - b.long_term_fee);
35
+ }
36
return a.GetSelectionAmount() > b.GetSelectionAmount();
37
38
} descending;
0 commit comments