Skip to content

Commit

Permalink
Fix coin selection.
Browse files Browse the repository at this point in the history
  • Loading branch information
gmart7t2 committed Nov 22, 2023
1 parent 03468a6 commit 8be0705
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/subcommand/wallet/transaction_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,13 @@ impl TransactionBuilder {
current_value >= target_value && is_closer
};

if is_preference_and_closer || not_preference_but_closer {
let newly_meets_preference = if prefer_under {
best_value > target_value && current_value <= target_value
} else {
best_value < target_value && current_value >= target_value
};

if is_preference_and_closer || not_preference_but_closer || newly_meets_preference {
best_match = Some((*utxo, current_value))
}
}
Expand Down

0 comments on commit 8be0705

Please sign in to comment.