Skip to content

Commit

Permalink
don't create ws with local intranet
Browse files Browse the repository at this point in the history
  • Loading branch information
Cabecinha84 committed Oct 5, 2024
1 parent bfb8c37 commit 28a2fe5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ZelBack/src/services/fluxCommunication.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 28a2fe5

Please sign in to comment.