From 56e4bace42c99a87a50333916131a5fe851a6dff Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Mon, 3 Oct 2016 14:43:35 -0700 Subject: [PATCH] wallet: account options. --- lib/wallet/wallet.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/wallet/wallet.js b/lib/wallet/wallet.js index f71880dd..5b9d6962 100644 --- a/lib/wallet/wallet.js +++ b/lib/wallet/wallet.js @@ -665,21 +665,21 @@ Wallet.prototype._createAccount = co(function* createAccount(options) { throw new Error('Cannot add xprivkey to watch-only wallet.'); } else { key = master.deriveAccount44(this.accountDepth); + key = key.hdPublicKey; } options = { - network: this.network, wid: this.wid, id: this.id, name: this.accountDepth === 0 ? 'default' : name, witness: options.witness, - accountKey: key.hdPublicKey, + watchOnly: this.watchOnly, + accountKey: key, accountIndex: this.accountDepth, type: options.type, - keys: options.keys, m: options.m, n: options.n, - watchOnly: this.watchOnly + keys: options.keys }; this.start(); @@ -706,16 +706,16 @@ Wallet.prototype._createAccount = co(function* createAccount(options) { */ Wallet.prototype.ensureAccount = co(function* ensureAccount(options) { - var acct = options.account; + var name = options.account; var exists; if (typeof options.name === 'string') - acct = options.name; + name = options.name; - exists = yield this.hasAccount(acct); + exists = yield this.hasAccount(name); if (exists) - return yield this.getAccount(acct); + return yield this.getAccount(name); return this.createAccount(options); });