From 97bcdd79c2ed5e53958d255c8b6e0a64a7ead234 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Wed, 3 Feb 2016 21:35:07 -0800 Subject: [PATCH] minor fixes --- lib/bcoin/address.js | 3 +++ lib/bcoin/wallet.js | 2 ++ 2 files changed, 5 insertions(+) diff --git a/lib/bcoin/address.js b/lib/bcoin/address.js index 0d871639..ebd09ded 100644 --- a/lib/bcoin/address.js +++ b/lib/bcoin/address.js @@ -22,6 +22,9 @@ function Address(options) { if (!(this instanceof Address)) return new Address(options); + if (options instanceof Address) + return options; + EventEmitter.call(this); if (!options) diff --git a/lib/bcoin/wallet.js b/lib/bcoin/wallet.js index f0968458..8729b581 100644 --- a/lib/bcoin/wallet.js +++ b/lib/bcoin/wallet.js @@ -242,6 +242,8 @@ Wallet.prototype._initAddresses = function() { assert(!this._initialized); this._initialized = true; + delete this.current; + options.addresses.forEach(function(address) { address = this.addAddress(address); if (!this.hd) {