From 0152cb45a855b0b25275f2d07f70548e01d672dd Mon Sep 17 00:00:00 2001 From: Manuel Araoz Date: Tue, 27 May 2014 16:16:22 -0300 Subject: [PATCH 1/2] optimize address generation protocol --- js/models/core/Wallet.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/js/models/core/Wallet.js b/js/models/core/Wallet.js index 55bc54305..bef624db9 100644 --- a/js/models/core/Wallet.js +++ b/js/models/core/Wallet.js @@ -82,14 +82,9 @@ Wallet.prototype._handlePublicKeyRing = function(senderId, data, isInbound) { var hasChanged = pkr.merge(inPKR, true); if (hasChanged) { - this.connectToAll(); if (this.publicKeyRing.isComplete()) { this._lockIncomming(); } - this.log('### BROADCASTING PKR'); - - recipients = null; - this.sendPublicKeyRing(recipients); } this.emit('publicKeyRingUpdated'); this.store(); From 065864beab35a94209e588a0a3905269ff92b8b2 Mon Sep 17 00:00:00 2001 From: Manuel Araoz Date: Tue, 27 May 2014 17:05:43 -0300 Subject: [PATCH 2/2] 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(); }