diff --git a/lib/privatekey.js b/lib/privatekey.js index 2f56072..dfd4638 100644 --- a/lib/privatekey.js +++ b/lib/privatekey.js @@ -158,17 +158,10 @@ PrivateKey._transformBuffer = function(buf, network) { info.network = Networks.get(buf[0], 'privatekey'); - var allNetworks = Networks.all(); - var matches = _.filter( allNetworks, function( network) { - return buf[0] === network.privatekey; - }); - - if (matches.length !== 1) { + if (!info.network) { throw new Error('Invalid network'); } - info.network = matches[0]; - if (network && info.network !== Networks.get(network)) { throw new TypeError('Private key network mismatch'); }