remove unnecessary filtering code

This commit is contained in:
Brandon Roberts 2015-06-20 14:26:01 -07:00
parent a53bd10f42
commit e07186df07

View File

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