mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-27 15:28:49 +02:00
wallet: if only have one output type, don't perform "mixed" coin selection
there is nothing to mix.
This commit is contained in:
@@ -524,8 +524,9 @@ std::optional<SelectionResult> AttemptSelection(const CWallet& wallet, const CAm
|
||||
if (results.size() > 0) return *std::min_element(results.begin(), results.end());
|
||||
|
||||
// If we can't fund the transaction from any individual OutputType, run coin selection one last time
|
||||
// over all available coins, which would allow mixing
|
||||
if (allow_mixed_output_types) {
|
||||
// over all available coins, which would allow mixing.
|
||||
// If TypesCount() <= 1, there is nothing to mix.
|
||||
if (allow_mixed_output_types && available_coins.TypesCount() > 1) {
|
||||
if (auto result{ChooseSelectionResult(wallet, nTargetValue, eligibility_filter, available_coins.All(), coin_selection_params)}) {
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user