From 3bdf35c6abf0083d7c46e097381e8d74aec6db12 Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Mon, 5 Jan 2015 14:30:25 -0300 Subject: [PATCH] send walletReady always for incomplete wallets --- js/models/Wallet.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/js/models/Wallet.js b/js/models/Wallet.js index 42ad94aeb..53a7690e8 100644 --- a/js/models/Wallet.js +++ b/js/models/Wallet.js @@ -690,9 +690,6 @@ Wallet.prototype._onNoMessages = function() { if (this.isComplete()) { log.debug('Wallet:' + this.getName() + ' No messages at the server. Requesting peer sync from: ' + (this.syncedTimestamp + 1)); this.sendWalletReady(null, parseInt((this.syncedTimestamp + 1) / 1000000)); - } else { - log.debug('Incomplete wallet:' + this.getName() + ' No messages at the server. Requesting forced peer sync from 0'); - this.sendWalletReady(null, 0, true); } }; @@ -992,7 +989,12 @@ Wallet.prototype.netStart = function() { if (this.publicKeyRing.isComplete()) { this._lockIncomming(this.publicKeyRing.getAllCopayerIds()); } else { - this.network.setCopayers(this.publicKeyRing.getAllCopayerIds()); + //Partially complete wallet. + if (this.publicKeyRing.getAllCopayerIds() > 1) { + this.network.setCopayers(this.publicKeyRing.getAllCopayerIds()); + log.debug('Incomplete wallet opened:' + this.getName() + '. forced peer sync from 0'); + this.sendWalletReady(null, 0, true); + } } log.debug('Wallet:' + self.id + ' Starting network.'); @@ -1216,7 +1218,7 @@ Wallet.fromObj = function(o, readOpts) { Wallet.prototype._sendToPeers = function(recipients, obj) { if (!this.isShared()) return; log.info('Wallet:' + this.getName() + ' ### Sending ' + obj.type); - log.debug('Sending:', recipients, obj); + log.debug('Sending:', recipients, obj); this.network.send(recipients, obj); };