From e07186df0770efe0160292e37d0cb39efd4fb99b Mon Sep 17 00:00:00 2001 From: Brandon Roberts Date: Sat, 20 Jun 2015 14:26:01 -0700 Subject: [PATCH] remove unnecessary filtering code --- lib/privatekey.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) 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'); }