From c4d97243e16585813e231a2ab130524ab84705f6 Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Wed, 18 Feb 2015 17:14:56 -0300 Subject: [PATCH 1/3] better status while incomplete --- lib/client/api.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/client/api.js b/lib/client/api.js index 2783609..e8f7b6f 100644 --- a/lib/client/api.js +++ b/lib/client/api.js @@ -85,13 +85,24 @@ API.prototype._tryToComplete = function(data, cb) { }; -API.prototype._loadAndCheck = function(cb) { + +API.prototype._load = function(cb) { var self = this; this.storage.load(function(err, data) { if (err || !data) { return cb(err || 'Wallet file not found.'); } + return cb(null, data); + }); +}; + + +API.prototype._loadAndCheck = function(cb) { + var self = this; + + this._load(function(err, data) { + if (err) return cb(err); if (data.n > 1) { var pkrComplete = data.publicKeyRing && data.m && data.publicKeyRing.length === data.n; @@ -274,7 +285,7 @@ API.prototype.joinWallet = function(secret, copayerName, cb) { API.prototype.getStatus = function(cb) { var self = this; - this._loadAndCheck(function(err, data) { + this._load(function(err, data) { if (err) return cb(err); var url = '/v1/wallets/'; From e64a85ca0f9f36726aa4d88df5023d1df278af5e Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Wed, 18 Feb 2015 17:18:10 -0300 Subject: [PATCH 2/3] add copayers names to status --- bit-wallet/bit-status | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bit-wallet/bit-status b/bit-wallet/bit-status index c904d0b..5d15a1f 100755 --- a/bit-wallet/bit-status +++ b/bit-wallet/bit-status @@ -20,6 +20,10 @@ client.getStatus(function(err, res) { var x = res.wallet; console.log('* Wallet %s [%s]: %d-%d %s ', x.name, x.network, x.m, x.n, x.status); + if (x.status != 'complete') + console.log(' Missing copayers:', x.n - x.copayers.length); + console.log('* Copayers:', _.pluck(x.copayers,'name').join(', ')); + var x = res.balance; console.log('* Balance %d (Locked: %d)', x.totalAmount, x.lockedAmount); From ba60d4e59a37ae717ef9d5f1de0be4fbe0a1cd62 Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Wed, 18 Feb 2015 17:20:31 -0300 Subject: [PATCH 3/3] rm console.log --- lib/server.js | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/server.js b/lib/server.js index b812a57..b810797 100644 --- a/lib/server.js +++ b/lib/server.js @@ -323,7 +323,6 @@ CopayServer.prototype._getBlockExplorer = function(provider, network) { url = 'https://test-insight.bitpay.com:443' break; } - console.log('[server.js.320:url:]', url); //TODO return new Explorers.Insight(url, network); break; }