Merge pull request #102 from matiu/feature/ux8

better sync for peers
This commit is contained in:
Ryan X. Charles 2014-04-20 17:29:29 -03:00
commit 0eaaa6bab7
4 changed files with 9 additions and 5 deletions

View file

@ -32,6 +32,8 @@ PrivateKey.fromObj = function(obj) {
};
PrivateKey.prototype.toObj = function() {
console.log('[PrivateKey.js.35] TODO TODO: PRIV: ', this.getExtendedPrivateKeyString()); //TODO
return {
extendedPrivateKeyString: this.getExtendedPrivateKeyString(),
networkName: this.network.name,

View file

@ -106,9 +106,11 @@ Wallet.prototype._handleData = function(senderId, data, isInbound) {
}
this.log('[Wallet.js.98]' , data.type); //TODO
switch(data.type) {
// This handler is repeaded on WalletFactory (#join). TODO
case 'walletId':
this.sendWalletReady(senderId);
break;
case 'walletReady':
console.log('[Wallet.js.109] RECV WALLETREADY'); //TODO
this.sendPublicKeyRing(senderId);
this.sendTxProposals(senderId);
break;
@ -189,6 +191,7 @@ console.log('[Wallet.js.177] NET START: emit CREATED'); //TODO
if (otherPeerId !== myPeerId) {
net.connectTo(otherPeerId);
}
self.emit('refresh');
}
}, startOpts);
};