mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-04 02:02:42 +02:00
wallet: run coin selection by OutputType
Run coin selection on each OutputType separately, choosing the best solution according to the waste metric. This is to avoid mixing UTXOs that are of different OutputTypes, which can hurt privacy. If no single OutputType can fund the transaction, then coin selection considers the entire wallet, potentially mixing (current behavior). This is done inside AttemptSelection so that all OutputTypes are considered at each back-off in coin selection.
This commit is contained in:
@@ -76,7 +76,7 @@ static void CoinSelection(benchmark::Bench& bench)
|
||||
/*avoid_partial=*/ false,
|
||||
};
|
||||
bench.run([&] {
|
||||
auto result = AttemptSelection(wallet, 1003 * COIN, filter_standard, available_coins, coin_selection_params);
|
||||
auto result = AttemptSelection(wallet, 1003 * COIN, filter_standard, available_coins, coin_selection_params, /*allow_mixed_output_types=*/true);
|
||||
assert(result);
|
||||
assert(result->GetSelectedValue() == 1003 * COIN);
|
||||
assert(result->GetInputSet().size() == 2);
|
||||
|
||||
Reference in New Issue
Block a user