Merge pull request #51 from matiaspando/feature/identity

adding message publicKeyRingUpdated
This commit is contained in:
Matias Alejo Garcia 2014-10-29 16:03:23 -03:00
commit 5a5a15e4ea
2 changed files with 14 additions and 1 deletions

View file

@ -390,6 +390,10 @@ Identity.prototype.bindWallet = function(w) {
log.debug('<addressBookUpdated> Wallet' + w.getName()); log.debug('<addressBookUpdated> Wallet' + w.getName());
self.storeWallet(w); self.storeWallet(w);
}); });
w.on('publicKeyRingUpdated', function() {
log.debug('<publicKeyRingUpdated> Wallet' + w.getName());
self.storeWallet(w);
});
}; };
/** /**

View file

@ -245,6 +245,14 @@ Wallet.prototype._newAddresses = function(dontUpdateUx) {
this.emitAndKeepAlive('newAddresses', dontUpdateUx); this.emitAndKeepAlive('newAddresses', dontUpdateUx);
}; };
Wallet.prototype._publicKeyRingUpdated = function(isComplete) {
if (isComplete) {
this.subscribeToAddresses();
};
this.emitAndKeepAlive('publicKeyRingUpdated');
};
/** /**
* @desc Handles an 'indexes' message. * @desc Handles an 'indexes' message.
* *
@ -321,7 +329,8 @@ Wallet.prototype._onPublicKeyRing = function(senderId, data) {
if (this.publicKeyRing.isComplete()) { if (this.publicKeyRing.isComplete()) {
this._lockIncomming(); this._lockIncomming();
} }
this._newAddresses();
this._publicKeyRingUpdated(this.publicKeyRing.isComplete());
} }
}; };