TransactionBroadcast: add awaitSent() method

This just returns the used internally (and therefore tested) `sentFuture`.
This commit is contained in:
Sean Gilligan 2023-03-26 13:24:30 -07:00 committed by Andreas Schildbach
parent bce7b11038
commit 2e3e6d4485

View File

@ -217,6 +217,15 @@ public class TransactionBroadcast {
.thenApply(tx -> this);
}
/**
* Wait for confirmation the transaction has been sent to a remote peer. (Or at least buffered to be sent to
* a peer.)
* @return A future that completes when the message has been relayed by the appropriate number of remote peers
*/
public CompletableFuture<TransactionBroadcast> awaitSent() {
return sentFuture;
}
/**
* If you migrate to {@link #broadcastAndAwaitRelay()} and need a {@link CompletableFuture} that returns
* {@link Transaction} you can use: