Browse Source

Merge pull request #39 from matiu/bug/status

Bug/status
activeAddress
Ivan Socolsky 10 years ago
parent
commit
77e31e0f43
  1. 4
      bit-wallet/bit-status
  2. 15
      lib/client/api.js
  3. 1
      lib/server.js

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

15
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/';

1
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;
}

Loading…
Cancel
Save