mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2024-11-19 09:50:32 +01:00
DefaultCoinSelector, AllowUnconfirmedCoinSelector: change return type of get()
to CoinSelector
This commit is contained in:
parent
116194f39e
commit
7879f24164
@ -28,7 +28,7 @@ public class AllowUnconfirmedCoinSelector extends DefaultCoinSelector {
|
||||
return true;
|
||||
}
|
||||
|
||||
public static AllowUnconfirmedCoinSelector get() {
|
||||
public static CoinSelector get() {
|
||||
return new AllowUnconfirmedCoinSelector();
|
||||
}
|
||||
}
|
||||
|
@ -104,7 +104,7 @@ public class DefaultCoinSelector implements CoinSelector {
|
||||
(confidence.numBroadcastPeers() > 0 || tx.getParams().network() == BitcoinNetwork.REGTEST);
|
||||
}
|
||||
|
||||
public static DefaultCoinSelector get() {
|
||||
public static CoinSelector get() {
|
||||
return new DefaultCoinSelector();
|
||||
}
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ public class DefaultCoinSelectorTest extends TestWithWallet {
|
||||
Transaction t2 = Objects.requireNonNull(sendMoneyToWallet(AbstractBlockChain.NewBlockType.BEST_CHAIN, COIN));
|
||||
|
||||
// Check we selected just the oldest one.
|
||||
DefaultCoinSelector selector = DefaultCoinSelector.get();
|
||||
CoinSelector selector = DefaultCoinSelector.get();
|
||||
CoinSelection selection = selector.select(COIN, wallet.calculateAllSpendCandidates());
|
||||
assertTrue(selection.outputs().contains(t1.getOutputs().get(0)));
|
||||
assertEquals(COIN, selection.totalValue());
|
||||
@ -136,7 +136,7 @@ public class DefaultCoinSelectorTest extends TestWithWallet {
|
||||
);
|
||||
t.getConfidence().setConfidenceType(TransactionConfidence.ConfidenceType.BUILDING);
|
||||
|
||||
DefaultCoinSelector selector = DefaultCoinSelector.get();
|
||||
CoinSelector selector = DefaultCoinSelector.get();
|
||||
CoinSelection selection = selector.select(COIN.multiply(2), outputs);
|
||||
|
||||
assertTrue(selection.outputs().size() == 4);
|
||||
|
Loading…
Reference in New Issue
Block a user