Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
RunOnFluxBot committed Nov 13, 2023
1 parent b636c6b commit af7d18c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions services/fluxCommunication.js
Original file line number Diff line number Diff line change
Expand Up @@ -502,15 +502,15 @@ async function initiateAndHandleConnection(connection) {
websocket.onclose = (evt) => {
const ocIndex = outgoingConnections.indexOf(websocket);
if (ocIndex > -1) {
log.info(`Connection to ${connection} closed with code ${evt.code}`);
log.info(`Connection to ${ip}:${port} closed with code ${evt.code}`);
outgoingConnections.splice(ocIndex, 1);
}
const foundPeer = outgoingPeers.find((peer) => peer.ip === ip && peer.port === port);
if (foundPeer) {
const peerIndex = outgoingPeers.indexOf(foundPeer);
if (peerIndex > -1) {
outgoingPeers.splice(peerIndex, 1);
log.info(`Connection ${connection} removed from outgoingPeers`);
log.info(`Connection ${ip}:${port} removed from outgoingPeers`);
}
}
};
Expand Down Expand Up @@ -595,15 +595,15 @@ async function initiateAndHandleConnection(connection) {
websocket.onerror = (evt) => {
const ocIndex = outgoingConnections.indexOf(websocket);
if (ocIndex > -1) {
log.info(`Connection to ${connection} errord with code ${evt.code}`);
log.info(`Connection to ${ip}:${port} errord with code ${evt.code}`);
outgoingConnections.splice(ocIndex, 1);
}
const foundPeer = outgoingPeers.find((peer) => peer.ip === ip && peer.port === port);
if (foundPeer) {
const peerIndex = outgoingPeers.indexOf(foundPeer);
if (peerIndex > -1) {
outgoingPeers.splice(peerIndex, 1);
log.info(`Connection ${connection} removed from outgoingPeers`);
log.info(`Connection ${ip}:${port} removed from outgoingPeers`);
}
}
};
Expand Down

0 comments on commit af7d18c

Please sign in to comment.