fix(p2p): additional myself check
This commit is contained in:
parent
80ad766d33
commit
829a12be35
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user