|
|
@ -368,12 +368,14 @@ PrivateKey.prototype.toPublicKey = function(){ |
|
|
|
|
|
|
|
/** |
|
|
|
* Will return an address for the private key |
|
|
|
* @param {Network=} network - optional parameter specifying |
|
|
|
* the desired network for the address |
|
|
|
* |
|
|
|
* @returns {Address} An address generated from the private key |
|
|
|
*/ |
|
|
|
PrivateKey.prototype.toAddress = function() { |
|
|
|
PrivateKey.prototype.toAddress = function(network) { |
|
|
|
var pubkey = this.toPublicKey(); |
|
|
|
return Address.fromPublicKey(pubkey, this.network); |
|
|
|
return Address.fromPublicKey(pubkey, network || this.network); |
|
|
|
}; |
|
|
|
|
|
|
|
/** |
|
|
|