Browse Source

PrivateKey: Use defaultNetwork if not specified

patch-2
Braydon Fuller 10 years ago
parent
commit
b91b0fe4a5
  1. 6
      lib/privatekey.js

6
lib/privatekey.js

@ -40,7 +40,7 @@ var PrivateKey = function PrivateKey(data, network, compressed) {
var info = {
compressed: typeof(compressed) !== 'undefined' ? compressed : true,
network: network || 'livenet'
network: network || networks.defaultNetwork.name
};
// detect type of data
@ -116,9 +116,9 @@ PrivateKey._transformBuffer = function(buf, network, compressed) {
}
if (buf[0] === networks.livenet.privatekey) {
info.network = 'livenet';
info.network = networks.livenet.name;
} else if (buf[0] === networks.testnet.privatekey) {
info.network = 'testnet';
info.network = networks.testnet.name;
} else {
throw new Error('Invalid network');
}

Loading…
Cancel
Save