mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-02-12 10:15: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;
|
||||
|
||||
public static class TxFuturePair {
|
||||
public Transaction tx;
|
||||
public SettableFuture<Transaction> future;
|
||||
public final Transaction tx;
|
||||
public final SettableFuture<Transaction> future;
|
||||
|
||||
public TxFuturePair(Transaction tx, SettableFuture<Transaction> future) {
|
||||
this.tx = tx;
|
||||
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>();
|
||||
|
Loading…
x
Reference in New Issue
Block a user