fix join flow

This commit is contained in:
Matias Alejo Garcia 2014-10-14 19:49:29 -03:00
commit b391344daf
4 changed files with 26 additions and 18 deletions

View file

@ -294,11 +294,13 @@ Network.prototype.greet = function(copayerId, secretNumber) {
};
Network.prototype._addCopayerMap = function(peerId, copayerId) {
console.log('[Async.js.296:_addCopayerMap:]',peerId, copayerId); //TODO
if (!this.copayerForPeer[peerId]) {
if (Object.keys(this.copayerForPeer).length < this.maxPeers) {
this.copayerForPeer[peerId] = copayerId;
}
}
console.log('[Async.js.296:_addCopayerMap:]',this.copayerForPeer); //TODO
};
Network.prototype._setInboundPeerAuth = function(peerId) {
@ -374,6 +376,7 @@ Network.prototype.send = function(dest, payload, cb) {
dest = this.getCopayerIds();
payload.isBroadcast = 1;
}
console.log('[Async.js.374:dest:]',dest); //TODO
if (typeof dest === 'string')
dest = [dest];