public class TransactionBroadcast extends Object
Wallet
and needs to be sent to the network. A broadcast can succeed or fail. A success is
defined as seeing the transaction be announced by peers via inv messages, thus indicating their acceptance. A failure
is defined as not reaching acceptance within a timeout period, or getting an explicit reject message from a peer
indicating that the transaction was not acceptable.Modifier and Type | Class and Description |
---|---|
static interface |
TransactionBroadcast.ProgressCallback
An interface for receiving progress information on the propagation of the tx, from 0.0 to 1.0
|
Modifier and Type | Field and Description |
---|---|
static Random |
random
Used for shuffling the peers before broadcast: unit tests can replace this to make themselves deterministic.
|
Modifier and Type | Method and Description |
---|---|
ListenableFuture<Transaction> |
broadcast() |
static TransactionBroadcast |
createMockBroadcast(Transaction tx,
SettableFuture<Transaction> future) |
ListenableFuture<Transaction> |
future() |
void |
setMinConnections(int minConnections) |
void |
setProgressCallback(TransactionBroadcast.ProgressCallback callback)
Sets the given callback for receiving progress values, which will run on the user thread.
|
void |
setProgressCallback(TransactionBroadcast.ProgressCallback callback,
Executor executor)
Sets the given callback for receiving progress values, which will run on the given executor.
|
public static Random random
public static TransactionBroadcast createMockBroadcast(Transaction tx, SettableFuture<Transaction> future)
public ListenableFuture<Transaction> future()
public void setMinConnections(int minConnections)
public ListenableFuture<Transaction> broadcast()
public void setProgressCallback(TransactionBroadcast.ProgressCallback callback)
Threading
for details. If the broadcast has already started then the callback will
be invoked immediately with the current progress.public void setProgressCallback(TransactionBroadcast.ProgressCallback callback, @Nullable Executor executor)
Copyright © 2016. All rights reserved.