/** Returns a global static instance of the selector. */ public static AllowUnconfirmedCoinSelector get() { // This doesn't have to be thread safe as the object has no state, so discarded duplicates are harmless. if (instance == null) instance = new AllowUnconfirmedCoinSelector(); return instance; } }
/** Returns a global static instance of the selector. */ public static AllowUnconfirmedCoinSelector get() { // This doesn't have to be thread safe as the object has no state, so discarded duplicates are harmless. if (instance == null) instance = new AllowUnconfirmedCoinSelector(); return instance; } }
/** Returns a global static instance of the selector. */ public static AllowUnconfirmedCoinSelector get() { // This doesn't have to be thread safe as the object has no state, so discarded duplicates are harmless. if (instance == null) instance = new AllowUnconfirmedCoinSelector(); return instance; } }
/** Returns a global static instance of the selector. */ public static AllowUnconfirmedCoinSelector get() { // This doesn't have to be thread safe as the object has no state, so discarded duplicates are harmless. if (instance == null) instance = new AllowUnconfirmedCoinSelector(); return instance; } }
@Test public void testStandardWalletDisconnect() throws Exception { NetworkParameters params = UnitTestParams.get(); Wallet w = new Wallet(new Context(params)); w.setCoinSelector(new AllowUnconfirmedCoinSelector()); Address a = w.currentReceiveAddress(); Transaction tx1 = FakeTxBuilder.createFakeTxWithoutChangeAddress(params, Coin.COIN, a); w.receivePending(tx1, null); Transaction tx2 = new Transaction(params); tx2.addOutput(Coin.valueOf(99000000), new ECKey()); w.completeTx(SendRequest.forTx(tx2)); TransactionInput txInToDisconnect = tx2.getInput(0); assertEquals(tx1, txInToDisconnect.getOutpoint().fromTx); assertNull(txInToDisconnect.getOutpoint().connectedOutput); txInToDisconnect.disconnect(); assertNull(txInToDisconnect.getOutpoint().fromTx); assertNull(txInToDisconnect.getOutpoint().connectedOutput); }