From 126a24479a0f5669c464bf4e3cda866592bd7a2d Mon Sep 17 00:00:00 2001 From: Daniel McNally Date: Fri, 13 Oct 2017 13:25:38 -0400 Subject: [PATCH] Create distinct --key & --watch Creates a separate --key argument to be separate from --watch and avoid confusion. --- bin/cli | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/bin/cli b/bin/cli index bb438fa5..2f6f77a5 100755 --- a/bin/cli +++ b/bin/cli @@ -52,16 +52,10 @@ CLI.prototype.createWallet = async function createWallet() { n: this.config.uint('n'), witness: this.config.bool('witness'), passphrase: this.config.str('passphrase'), - watchOnly: false, - accountKey: null + watchOnly: this.config.has('key') ? true : this.config.bool('watch'), + accountKey: this.config.str('key') }; - if (this.config.has('watch')) { - options.watchOnly = true; - if (this.config.str('watch') != 'true') - options.accountKey = this.config.str('watch'); - } - const wallet = await this.client.createWallet(options); this.log(wallet); @@ -127,7 +121,7 @@ CLI.prototype.createAccount = async function createAccount() { m: this.config.uint('m'), n: this.config.uint('n'), witness: this.config.bool('witness'), - accountKey: this.config.str('watch') + accountKey: this.config.str('key') }; const account = await this.wallet.createAccount(name, options);