diff --git a/src/background/p2p.js b/src/background/p2p.js index 5b1d4222..a5e9f53c 100644 --- a/src/background/p2p.js +++ b/src/background/p2p.js @@ -116,6 +116,11 @@ class p2p { return; } + if(data.peerId === this.peerId) { + logT('p2p', 'try connection to myself, ignore', this.peerId) + return; + } + for(const peer of this.clients) { if(peer.peerId === data.peerId) { // already connected from different interface @@ -544,6 +549,13 @@ class p2p { return; } + // ignore myself check + if(data.peerId === this.peerId) { + logT('p2p', 'try connection to myself, ignore', this.peerId) + rawSocket.destroy() + return; + } + for(let peer of this.peers) { if(peer.peerId === data.peerId) { // already connected from different interface