From 61c22c581dd5991777627e1a12538a4257759162 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Fri, 21 Apr 2023 14:39:01 +0000 Subject: [PATCH] Clarify the error message when we disconnect a peer We very regularly receive confusion over the super generic "Peer sent invalid data or we decided to disconnect due to a protocol error" message, which doesn't say very much. Usually, we end up disconnecting because we have a duplicate connection with a peer, which doesn't merit such a scary message. Instead, here we clarify the error message to just refer to the fact that we're disconnecting, and note that its usually a dup connection in a parenthetical. --- lightning/src/ln/peer_handler.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lightning/src/ln/peer_handler.rs b/lightning/src/ln/peer_handler.rs index 8ec9d7295..2fbb22e88 100644 --- a/lightning/src/ln/peer_handler.rs +++ b/lightning/src/ln/peer_handler.rs @@ -1056,7 +1056,7 @@ impl Ok(res), Err(e) => { - log_trace!(self.logger, "Peer sent invalid data or we decided to disconnect due to a protocol error"); + log_trace!(self.logger, "Disconnecting peer due to a protocol error (usually a duplicate connection)."); self.disconnect_event_internal(peer_descriptor); Err(e) } -- 2.39.5