fix wallet creation problem

This commit is contained in:
Manuel Araoz 2014-05-27 17:05:43 -03:00
parent 0152cb45a8
commit 065864beab
1 changed files with 6 additions and 2 deletions

View File

@ -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();
}