Removed double network call

This commit is contained in:
Braydon Fuller 2015-07-08 15:29:54 -04:00
parent ef26931645
commit e8446d4537
1 changed files with 1 additions and 2 deletions

View File

@ -780,12 +780,11 @@ Script.prototype.getAddressInfo = function() {
* @return {Address|boolean} the associated address for this script if possible, or false
*/
Script.prototype.toAddress = function(network) {
network = Networks.get(network) || this._network || Networks.defaultNetwork;
var info = this.getAddressInfo();
if (!info) {
return false;
}
info.network = Networks.get(network) || Networks.defaultNetwork;
info.network = Networks.get(network) || this._network || Networks.defaultNetwork;
return new Address(info);
};