From a30ad49f63410580fea27874f824da719f6232d9 Mon Sep 17 00:00:00 2001 From: Alekos Filini Date: Fri, 13 Nov 2020 15:55:10 +0100 Subject: [PATCH] [wallet] Use the branch-and-bound cs by default Keep the `LargestFirst` coin selection for the tests, to make them more predictable. --- src/wallet/coin_selection.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/wallet/coin_selection.rs b/src/wallet/coin_selection.rs index c5262482..ba67ef56 100644 --- a/src/wallet/coin_selection.rs +++ b/src/wallet/coin_selection.rs @@ -119,7 +119,10 @@ use rand::{rngs::StdRng, SeedableRng}; /// Default coin selection algorithm used by [`TxBuilder`](super::tx_builder::TxBuilder) if not /// overridden -pub type DefaultCoinSelectionAlgorithm = LargestFirstCoinSelection; +#[cfg(not(test))] +pub type DefaultCoinSelectionAlgorithm = BranchAndBoundCoinSelection; +#[cfg(test)] +pub type DefaultCoinSelectionAlgorithm = LargestFirstCoinSelection; // make the tests more predictable /// Result of a successful coin selection #[derive(Debug)]