mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-02-13 02:35:52 +00:00
Add a convenience method to MockTransactionBroadcaster.TxFuturePair
This commit is contained in:
parent
38e3f6fb9d
commit
8b8adc6fed
@ -39,13 +39,18 @@ public class MockTransactionBroadcaster implements TransactionBroadcaster {
|
|||||||
private final Wallet wallet;
|
private final Wallet wallet;
|
||||||
|
|
||||||
public static class TxFuturePair {
|
public static class TxFuturePair {
|
||||||
public Transaction tx;
|
public final Transaction tx;
|
||||||
public SettableFuture<Transaction> future;
|
public final SettableFuture<Transaction> future;
|
||||||
|
|
||||||
public TxFuturePair(Transaction tx, SettableFuture<Transaction> future) {
|
public TxFuturePair(Transaction tx, SettableFuture<Transaction> future) {
|
||||||
this.tx = tx;
|
this.tx = tx;
|
||||||
this.future = future;
|
this.future = future;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Tells the broadcasting code that the broadcast was a success, just does future.set(tx) */
|
||||||
|
public void succeed() {
|
||||||
|
future.set(tx);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private final LinkedBlockingQueue<TxFuturePair> broadcasts = new LinkedBlockingQueue<TxFuturePair>();
|
private final LinkedBlockingQueue<TxFuturePair> broadcasts = new LinkedBlockingQueue<TxFuturePair>();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user