diff --git a/js/models/Identity.js b/js/models/Identity.js index 0ea694285..b57f72a5d 100644 --- a/js/models/Identity.js +++ b/js/models/Identity.js @@ -390,6 +390,10 @@ Identity.prototype.bindWallet = function(w) { log.debug(' Wallet' + w.getName()); self.storeWallet(w); }); + w.on('publicKeyRingUpdated', function() { + log.debug(' Wallet' + w.getName()); + self.storeWallet(w); + }); }; /** diff --git a/js/models/Wallet.js b/js/models/Wallet.js index f9f067b7f..12935d98b 100644 --- a/js/models/Wallet.js +++ b/js/models/Wallet.js @@ -245,6 +245,14 @@ Wallet.prototype._newAddresses = function(dontUpdateUx) { this.emitAndKeepAlive('newAddresses', dontUpdateUx); }; + +Wallet.prototype._publicKeyRingUpdated = function(isComplete) { + if (isComplete) { + this.subscribeToAddresses(); + }; + this.emitAndKeepAlive('publicKeyRingUpdated'); +}; + /** * @desc Handles an 'indexes' message. * @@ -321,7 +329,8 @@ Wallet.prototype._onPublicKeyRing = function(senderId, data) { if (this.publicKeyRing.isComplete()) { this._lockIncomming(); } - this._newAddresses(); + + this._publicKeyRingUpdated(this.publicKeyRing.isComplete()); } };