HDNode: adopt new strict network list parameters

This commit is contained in:
Daniel Cousens 2015-07-28 17:47:18 +10:00
parent 307b7f036a
commit f47decaa2f
5 changed files with 41 additions and 42 deletions

View file

@ -83,7 +83,7 @@ ECPair.fromWIF = function (string, networks) {
// list of networks?
if (Array.isArray(networks)) {
network = networks.filter(function (network) {
return network.wif === version
return version === network.wif
}).pop() || {}
// otherwise, assume a network object (or default to bitcoin)
@ -91,7 +91,7 @@ ECPair.fromWIF = function (string, networks) {
network = networks || NETWORKS.bitcoin
}
if (network.wif !== version) throw new Error('Invalid network')
if (version !== network.wif) throw new Error('Invalid network')
var d = BigInteger.fromBuffer(payload)