From d28716c98d30d70406a3b04de219f79b02202e6a Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Sun, 20 Dec 2015 19:35:56 -0800 Subject: [PATCH] use regular addresses for wallet prefix. --- lib/bcoin/wallet.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/bcoin/wallet.js b/lib/bcoin/wallet.js index 1d5d0a89..489072f4 100644 --- a/lib/bcoin/wallet.js +++ b/lib/bcoin/wallet.js @@ -80,6 +80,8 @@ function Wallet(options, passphrase) { this.m = 1; this.n = 1; + this.prefix = 'bt/' + this.getOwnAddress() + '/'; + this.multisig(options.multisig || {}); this.tx = new bcoin.txPool(this); @@ -122,9 +124,10 @@ Wallet.prototype._init = function init() { }); }; -Wallet.prototype.__defineGetter__('prefix', function() { - return 'bt/' + this.getFullAddress() + '/'; -}); +// If we want to use p2sh addresses for the prefix: +// Wallet.prototype.__defineGetter__('prefix', function() { +// return 'bt/' + this.getFullAddress() + '/'; +// }); Wallet.prototype.multisig = function multisig(options) { var pub = this.getOwnPublicKey(); @@ -200,7 +203,7 @@ Wallet.prototype.derive = function derive() { options.priv = this.hd.derive.apply(this.hd, arguments); - return bcoin.wallet(options); + return new Wallet(options); }; Wallet.prototype.getPrivateKey = function getPrivateKey(enc) {