]> Untitled Git - bdk/commitdiff
[wallet] Use the branch-and-bound cs by default
authorAlekos Filini <alekos.filini@gmail.com>
Fri, 13 Nov 2020 14:55:10 +0000 (15:55 +0100)
committerAlekos Filini <alekos.filini@gmail.com>
Mon, 16 Nov 2020 13:08:04 +0000 (14:08 +0100)
Keep the `LargestFirst` coin selection for the tests, to make them more
predictable.

src/wallet/coin_selection.rs

index c52624826cc4959cac15c05748c81ef0c50dcac7..ba67ef56818f6c26952f08793c57440d5fc4ff24 100644 (file)
@@ -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)]