From 28a2fe571986b955a69ee93e9eca157b4e57274d Mon Sep 17 00:00:00 2001 From: Cabecinha84 Date: Sat, 5 Oct 2024 17:02:32 +0100 Subject: [PATCH] don't create ws with local intranet --- ZelBack/src/services/fluxCommunication.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ZelBack/src/services/fluxCommunication.js b/ZelBack/src/services/fluxCommunication.js index 713d11079..bac3fc1da 100644 --- a/ZelBack/src/services/fluxCommunication.js +++ b/ZelBack/src/services/fluxCommunication.js @@ -1025,6 +1025,10 @@ async function fluxDiscovery() { const fixedIndex = fluxNodeIndex + i < sortedNodeList.length ? fluxNodeIndex + i : fluxNodeIndex + i - sortedNodeList.length; const { ip } = sortedNodeList[fixedIndex]; const ipInc = ip.split(':')[0]; + if (ipInc === myIP.split(':')[0]) { + // eslint-disable-next-line no-continue + continue; + } const portInc = ip.split(':')[1] || '16127'; // additional precaution const clientExists = outgoingConnections.find((client) => client.ip === ipInc && client.port === portInc); @@ -1041,6 +1045,10 @@ async function fluxDiscovery() { const fixedIndex = fluxNodeIndex - i > 0 ? fluxNodeIndex - i : sortedNodeList.length - fluxNodeIndex - i; const { ip } = sortedNodeList[fixedIndex]; const ipInc = ip.split(':')[0]; + if (ipInc === myIP.split(':')[0]) { + // eslint-disable-next-line no-continue + continue; + } const portInc = ip.split(':')[1] || '16127'; // additional precaution const clientExists = outgoingConnections.find((client) => client.ip === ipInc && client.port === portInc);