aboutsummaryrefslogtreecommitdiff
path: root/src/bench
diff options
context:
space:
mode:
authorjosibake <josibake@protonmail.com>2022-03-25 20:57:40 +0100
committerjosibake <josibake@protonmail.com>2022-07-19 18:42:15 +0200
commit438e04845bf3302b7f459a50e88a1b772527f1e6 (patch)
tree03d7d123182583c6e46b6525dd806ed15b908c5b /src/bench
parent77b07072061c59f50c69be29fbcddf0d433e1077 (diff)
downloadbitcoin-438e04845bf3302b7f459a50e88a1b772527f1e6.tar.xz
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.
Diffstat (limited to 'src/bench')
-rw-r--r--src/bench/coin_selection.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bench/coin_selection.cpp b/src/bench/coin_selection.cpp
index bb3ced8406..a80ec3703c 100644
--- a/src/bench/coin_selection.cpp
+++ b/src/bench/coin_selection.cpp
@@ -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);