* Add a private member called `sentFuture` that completes when the broadcast
is "sent" (written to buffer) to the broadcast peers
* Update the broadcast() method to track success/failure of the individual
broadcast messages and update sentFuture when the individual messages complete.
(This is done by using `thenComposeAsync`/`whenComplete`)
* Add comments and TODOs
* Simplifies the lambda in broadcast:
** shortens it by two lines of code
** makes `peers` effectively final
** doesn't mutate the list `peers` with `shuffle`
* chooseBroadastPeers() gets JavaDoc
* chooseBroadastPeers() is more testable
Rationale:
* The comment says that it is a "list"
* Immutable Lists are the collection that maps most easily/logically to and from Stream
* Lists are easier to enforce reproducibility (mainly for unit tests)
* Use `startAsync()` for the blocking case, too. Since we were already
waiting on `downloadListner.await()`
* Make sure `installShutdownHook()` is called in both cases (bug fix)
* Add more comments
Remove the very long try/catch in startup that catches BlockStoreException
and rethrows it wrapped in an IOException.
The Guava service base class (`AbstractIdleService`) that we are extending
allows us to throw `Exception` so there is no reason to wrap the exception
and it can just be thrown directly.
LinuxSecureRandom used to be installed on Android because very old Android versions had a bug
in the random number generator. We don't support those old versions any more, so the workaround
has become unnecessary. It is still possible to initialize it manually if desired.
* WalletAppKit: add a constructor that takes a BitcoinNetwork
* WalletAppKit: deprecate constructors taking netParams or Context
* WalletAppKit: add an accessor for network()
* Update examples, tools, and wallettemplate to use the new constructor
Simplify the constructor for Wallet.SendRequest to only take
a TransactionBroadcast object. The transaction was inside
the TransactionBroadcast object anyway, we just had to create
an accessor.
This paves the way for removing SendResult entirely and replacing
it with TransactionBroadcast.
* Create TimeoutHandler interface
* Create standalone SocketTimeoutTask to implement it
* Deprecate and replace AbstractTimeoutHandler
This simplifies the inheritance of PeerSocketHandler and NioClient and
will enable future refactoring.
The only known usage of this feature is in the JavaFX wallettemplate where
it is used to save the estimated elapsed time for deriving a key for purposes
of displaying a progress bar.
* Add NetworkParameters.fromAddress() method to consolidate the use cases
where an Address is used to get a NetworkParameters
* Deprecate NetworkParameters.fromAddress() to indicate code must be rewritten
* This also removes one dependency on NetworkParameters in Address and helps
prepare for moving Address to `o.b.base`