Browse Source

remove unnecessary filtering code

patch-2
Brandon Roberts 10 years ago
parent
commit
e07186df07
  1. 9
      lib/privatekey.js

9
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');
}

Loading…
Cancel
Save