From 883700ea37b8235de259dd84a7e1b76e37dcff5f Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Sun, 14 Aug 2016 17:42:56 -0700 Subject: [PATCH] cli: set network. --- bin/cli | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/bin/cli b/bin/cli index 9cf64d57..5dc65e35 100755 --- a/bin/cli +++ b/bin/cli @@ -36,8 +36,8 @@ CLI.prototype.createWallet = function createWallet(callback) { if (this.config.master) options.master = this.config.master; - if (this.config.keys) - options.keys = this.config.keys.split(/[,:]/); + if (this.config.key) + options.key = this.config.key; if (this.config.m) options.m = this.config.m >>> 0; @@ -396,7 +396,8 @@ CLI.prototype.handleWallet = function handleWallet(callback) { this.wallet = new Wallet({ uri: this.config.url || this.config.uri, - apiKey: this.config.apiKey + apiKey: this.config.apiKey, + network: this.config.network }); this.wallet.open(options, function(err) { @@ -473,7 +474,8 @@ CLI.prototype.handleNode = function handleNode(callback) { this.client = new Client({ uri: this.config.url || this.config.uri, - apiKey: this.config.apiKey + apiKey: this.config.apiKey, + network: this.config.network }); this.client.getInfo(function(err, info) { @@ -543,9 +545,9 @@ CLI.prototype.open = function open(callback) { }; CLI.prototype.destroy = function destroy(callback) { - if (this.wallet) + if (this.wallet && !this.wallet.client.loading) this.wallet.client.destroy(); - if (this.client) + if (this.client && !this.client.loading) this.client.destroy(); callback(); };