* 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
* Create threadpool for reverseDns (rather than use new Thread() repeatedly)
* For getAddr() run completion handler on callback thread (and eliminate new Thread())
* Add getHostName() method that handles case where peerAddress.getAddr() is null
Distinguish between `Network` and `BitcoinNetwork` in the code
(some of our implementation supports alt-networks better than others
and this commit doesn't try to fix them all, just make it more clear
what is going on. Some may never be made 'generic')
This change migrates from using `NetworkParameters` to `Network` for specifying the network and
also decouples from static methods in `Address` with an interface/implementation approach.
Note that there are 3 use cases for address parsing:
1. Any network is allowed - AddressParser.parseAddressAnyNetwork(String)
2. Parse for a specified network - AddressParser.parseAddress(String, Network)
3. Parse for a previously-specified (context dependent) network - AddressParser.Strict.parseAddress(String)
In most use cases, an AddressParser instance can be accessed through the Wallet,
which already knows the Network type and in this context validation for network makes
sense. This is why `Wallet` is implementing `AddressParser.Strict`
BitcoinURI allocates its own DefaultAddressParser for now, as do some other tests
and examples that don't have access to a Wallet
In the future DefaultAddressParser may be replaced by something loaded
via the ServiceLoader mechanism or other dynamically configured mechanism.