fix(p2p): additional check of dublicated peers

This commit is contained in:
Alexey Kasyanchuk 2019-03-06 00:23:37 +01:00
parent c129b9717e
commit 726afd750c

View File

@ -384,6 +384,15 @@ class p2p {
return;
}
for(let peer of this.peers) {
if(peer.peerId === data.peerId) {
// already connected from different interface
logT('p2p', 'peer', data.peerId, 'already connected from different address', '( check:', peer.files === data.files && peer.torrents === data.torrents, ')');
rawSocket.destroy()
return;
}
}
// success
clearTimeout(protocolTimeout)