From cc48ea84d11e268cad06f3f597b3046041f5e880 Mon Sep 17 00:00:00 2001 From: Reynold Morel Date: Wed, 1 Nov 2023 14:11:42 -0400 Subject: [PATCH] Update some logs messages and variables --- .../main/java/co/rsk/net/discovery/PeerExplorer.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/rskj-core/src/main/java/co/rsk/net/discovery/PeerExplorer.java b/rskj-core/src/main/java/co/rsk/net/discovery/PeerExplorer.java index f3e9541fe81..9ed512b7708 100644 --- a/rskj-core/src/main/java/co/rsk/net/discovery/PeerExplorer.java +++ b/rskj-core/src/main/java/co/rsk/net/discovery/PeerExplorer.java @@ -165,7 +165,7 @@ synchronized void handleMessage(DiscoveryEvent event) { "type: [{}], " + "networkId: [{}]", state, event.getMessage().getMessageType(), - event.getMessage().getNetworkId().isPresent() ? event.getMessage().getNetworkId().getAsInt() : null); + event.getMessage().getNetworkId().isPresent()); if (state != ExecState.RUNNING) { logger.warn("Cannot handle message as current state is {}", state); @@ -178,7 +178,7 @@ synchronized void handleMessage(DiscoveryEvent event) { if (event.getMessage().getNetworkId().isPresent() && event.getMessage().getNetworkId().getAsInt() != this.networkId) { logger.warn("handleMessage - Message ignored because remote peer's network id: [{}] is different from local network id: [{}]", - event.getMessage().getNetworkId().getAsInt(), this.networkId); + event.getMessage().getNetworkId(), this.networkId); return; } if (type == DiscoveryMessageType.PING) { @@ -246,7 +246,7 @@ private void handleFindNode(FindNodePeerMessage message) { this.sendNeighbors(connectedNode.getAddress(), nodesToSend, message.getMessageId()); updateEntry(connectedNode); } else { - logger.warn("handleFindNode - Node with id [{}] is null", nodeId); + logger.warn("handleFindNode - Node with id: [{}] is not connected. Ignored", nodeId); } } @@ -274,7 +274,7 @@ private void handleNeighborsMessage(InetSocketAddress neighborsResponseAddress, } updateEntry(connectedNode); } else { - logger.warn("handleFindNode - Node with id [{}] is null", nodeId); + logger.warn("handleFindNode - Node with id: [{}] is not connected. Ignored", nodeId); } } @@ -290,7 +290,7 @@ synchronized PingPeerMessage sendPing(InetSocketAddress nodeAddress, int attempt PingPeerMessage nodeMessage = checkPendingPeerToAddress(nodeAddress); if (nodeMessage != null) { - logger.warn("sendPing - Node message to address [{}/{}] is null", nodeAddress.getHostName(), nodeAddress.getPort()); + logger.warn("sendPing - No ping message has been sent to address: [{}/{}], as there's pending one", nodeAddress.getHostName(), nodeAddress.getPort()); return nodeMessage; }