Create distinct --key & --watch

Creates a separate --key argument to be separate from --watch and avoid confusion.
This commit is contained in:
Daniel McNally 2017-10-13 13:25:38 -04:00 committed by GitHub
parent 3104220f1b
commit 126a24479a

12
bin/cli
View File

@ -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);