Skip to content

Commit e8d3a90

Browse files
authored
Merge pull request #3472 from ProvableHQ/fix/inbound-logging
Fix/inbound logging
2 parents b2f1809 + e7b948a commit e8d3a90

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

node/src/client/router.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,9 @@ impl<N: Network, C: ConsensusStorage<N>> Client<N, C> {
146146
) {
147147
// Process the message. Disconnect if the peer violated the protocol.
148148
if let Err(error) = self.inbound(peer_addr, message).await {
149+
error!("Failed to process inbound message from '{peer_addr}' - {error}");
149150
if let Some(peer_ip) = self.router().resolve_to_listener(&peer_addr) {
150-
warn!("Disconnecting from '{peer_ip}' - {error}");
151+
warn!("Disconnecting from '{peer_ip}' for protocol violation");
151152
Outbound::send(self, peer_ip, Message::Disconnect(DisconnectReason::ProtocolViolation.into()));
152153
// Disconnect from this peer.
153154
self.router().disconnect(peer_ip);

node/src/validator/router.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,9 @@ impl<N: Network, C: ConsensusStorage<N>> Validator<N, C> {
137137
) {
138138
// Process the message. Disconnect if the peer violated the protocol.
139139
if let Err(error) = self.inbound(peer_addr, message).await {
140+
error!("Failed to process inbound message from '{peer_addr}' - {error}");
140141
if let Some(peer_ip) = self.router().resolve_to_listener(&peer_addr) {
141-
warn!("Disconnecting from '{peer_ip}' - {error}");
142+
warn!("Disconnecting from '{peer_ip}' for protocol violation");
142143
Outbound::send(self, peer_ip, Message::Disconnect(DisconnectReason::ProtocolViolation.into()));
143144
// Disconnect from this peer.
144145
self.router().disconnect(peer_ip);

0 commit comments

Comments
 (0)