From: Matt Corallo Date: Fri, 21 Apr 2023 14:39:01 +0000 (+0000) Subject: Clarify the error message when we disconnect a peer X-Git-Tag: v0.0.115~2^2~1 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=61c22c581dd5991777627e1a12538a4257759162;p=rust-lightning 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. --- 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) }