adding message publicKeyRingUpdated

This commit is contained in:
Matias Pando 2014-10-29 14:53:52 -03:00
parent a93a48dc60
commit 31cab73193
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());
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);
};
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());
}
};