Update wif to 2.0.1

This commit is contained in:
Kirill Fomichev 2016-02-24 13:08:40 +03:00
parent 2f2e50092c
commit 48866992d4
3 changed files with 5 additions and 5 deletions

View file

@ -66,11 +66,12 @@ ECPair.fromWIF = function (string, network) {
network = network.filter(function (network) {
return version === network.wif
}).pop() || {}
}).pop()
if (!network) throw new Error('Invalid network version')
}
var decoded = wif.decodeRaw(network.wif, buffer)
var d = BigInteger.fromBuffer(decoded.d)
var decoded = wif.decodeRaw(buffer, network.wif)
var d = BigInteger.fromBuffer(decoded.privateKey)
return new ECPair(d, null, {
compressed: decoded.compressed,