* Add 3 new constructors which take Network
* Deprecate (2 of 3) constructors that take NetworkParameters
* Mark 3-arg NetworkParameters constructor as @VisibleForTesting
Catch FileNotFound error earlier and provide more informative
exception when it happens.
I discovered this issue running the WalletTool with an invalid directory
path to the wallet file. Before this fix the error/exception message is:
java.io.IOException: No such file or directory
After the fix it is:
java.io.FileNotFoundException: /Users/sean/bitcoinj (wallet directory not found)
Since P2SH-P2WPKH addresses do not contain the public itself – but instead
a value derived from a pubkey, namely
RIPEMD160(SHA256(0x00 0x14 <20-byte-pubKeyHash>)) - the verification of
signed messages got a bit more complicated (and different per address
type). To encapsulate this complexity and make it easy to use, this commit
introduces a new util class for verifying signed Bitcoin messages.
It also adds some test vectors partly from other projects implementing
the same functionality to test interoperability, as well as some publicly
known messages and signatures.
BIP 137 defined new header byte values for the created signature
when the signature was created with a private key from a segwit
address.
This commit extends the "signMessage(..)" with a new ScriptType argument
(because the value of the signature header since BIP 137 depends on the
address type). This commit keeps the old methods (without the ScriptType
argument), but marks them as deprecated (using P2SH as default, if called
without ScriptType, thus not changing old behaviour).
BIP 137 extended the allowed range of values for the header byte
of signatures (for signatures created from segwit addresses).
This commit reflects these changes and adds the newly allowed
header byte values to ECKey.signedMessageToKey(...).
Also adds test cases verifying signatures created with segwit addresses.
Adds peer addresses discovered via P2P to the list of potential peers to connect to.
This is enabled by default if at least one PeerDiscovery is set via addPeerDiscovery(),
and the default can be overridden with setDiscoverPeersViaP2P().
* Include `hostname` in equals() and hashcode()
* Fix NPE in toString() that occurs for (unsupported) I2P addresses (both addr and hostname are null)
* Better null-handling in equals()
* Add EqualsVerify test
* Add comments
Normalize/canonicalize network member of Address types.
LegacyAddress: map SIGNET, REGTEST to TESTNET
SegwitAddress: map SIGNET to TESTNET
Add tests to verify correct behavoir.