From 065864beab35a94209e588a0a3905269ff92b8b2 Mon Sep 17 00:00:00 2001 From: Manuel Araoz Date: Tue, 27 May 2014 17:05:43 -0300 Subject: [PATCH] fix wallet creation problem --- js/models/core/Wallet.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/js/models/core/Wallet.js b/js/models/core/Wallet.js index bef624db9..f221378ad 100644 --- a/js/models/core/Wallet.js +++ b/js/models/core/Wallet.js @@ -77,11 +77,15 @@ console.log('[Wallet.js.58] connecting'); //TODO Wallet.prototype._handlePublicKeyRing = function(senderId, data, isInbound) { this.log('RECV PUBLICKEYRING:', data); - var recipients, pkr = this.publicKeyRing; var inPKR = copay.PublicKeyRing.fromObj(data.publicKeyRing); + var wasIncomplete = !this.publicKeyRing.isComplete(); + var hasChanged = this.publicKeyRing.merge(inPKR, true); - var hasChanged = pkr.merge(inPKR, true); if (hasChanged) { + if (wasIncomplete) { + this.sendPublicKeyRing(); + this.connectToAll(); + } if (this.publicKeyRing.isComplete()) { this._lockIncomming(); }