Move the code that creates the forwarded transaction, signs, sends,
and waits for peer confirmation into a standalone method.
The `forward()` function is a relatively straightforward asynchronous function
that returns a `CompletableFuture` that either completes normally or exceptionally.
Constructors that take NetworkParameters are marked as @VisibleForTesting.
This is because of the special UNITTEST NetworkParameters that is required for
certain tests.
* Adds new methods taking `Network` rather than `NetworkParameters`
* Deprecates all converted methods
* Updates tests, examples, and tools that use these calls
* Deprecate public fields in `SendResult`
* Make available equivalent accessors
* Update all usages
This prepares the way for replacing `SendResult` with `TransactionBroadcast`
in the future.
* Add `awaitRelayed()` method that returns a CF that completes when relaying is confirmed.
* Deprecate `future()` and reimplement it using `awaitRelayed()`.
`Closeable` implements `AutoCloseable` but narrows the exception thrown
from `Exception` to `IOException`. ForwardingService.close() currently
doesn't throw any exceptions.
* native constructors that were meant to be called by consumers now have static equivalents
* all native constructors are discouraged from being used by a JavaDoc comment
* one constructor that wasn't meant to be used by consumers is switched to private access
* tests and tools that resemble consumers are updated to use the new API
Note: although most native constructors are now deprecated, we're not using
annotations because we're still calling them.
* Deprecate ByteUtils.HEX
* Migrate usages to new ByteUtils.formatHex() and ByteUtils.parseHex()
* Direct use of Guava BaseEncoding in tests that use some specific
features of BaseEncoding that aren't provided by new methods.
* Replace all usages of *Net*Params.get() with BitcoinNetwork.* enum
* Where NetworkParameters is needed get it with NetworkParameters.of(network)
This change does the following:
* Makes it clear that BitcoinNetwork.* is the preferred method of specifying/declaring
the active network.
* Prepares the way for examples to get the network string as a command-line arg
* Continues the general migration from NetworkParameters to Network
* Add 3 new constructors which take Network
* Deprecate (2 of 3) constructors that take NetworkParameters
* Mark 3-arg NetworkParameters constructor as @VisibleForTesting