ECPair/HDNode: missing version from list is Unknown, not Invalid
This commit is contained in:
parent
bdb0dd4a17
commit
aae5db6a59
4 changed files with 5 additions and 3 deletions
|
@ -66,6 +66,8 @@ ECPair.fromWIF = function (string, network) {
|
|||
network = network.filter(function (network) {
|
||||
return version === network.wif
|
||||
}).pop()
|
||||
|
||||
if (!network) throw new Error('Unknown network version')
|
||||
}
|
||||
|
||||
network = network || NETWORKS.bitcoin
|
||||
|
|
|
@ -66,7 +66,7 @@ HDNode.fromBase58 = function (string, networks) {
|
|||
version === network.bip32.public
|
||||
}).pop()
|
||||
|
||||
if (!network) throw new Error('Invalid network version')
|
||||
if (!network) throw new Error('Unknown network version')
|
||||
|
||||
// otherwise, assume a network object (or default to bitcoin)
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue