diff --git a/lightning/src/ln/peer_handler.rs b/lightning/src/ln/peer_handler.rs index 51695bba09a..80c9c78101e 100644 --- a/lightning/src/ln/peer_handler.rs +++ b/lightning/src/ln/peer_handler.rs @@ -1333,8 +1333,7 @@ impl Ok(res), Err(e) => { - log_trace!(self.logger, "Disconnecting peer due to a protocol error (usually a duplicate connection)."); - self.disconnect_event_internal(peer_descriptor); + self.disconnect_event_internal(peer_descriptor, "of a protocol error"); Err(e) } } @@ -2435,7 +2434,7 @@ impl { let peer = peer_lock.lock().unwrap(); if let Some((node_id, _)) = peer.their_node_id { - log_trace!(WithContext::from(&self.logger, Some(node_id), None, None), "Handling disconnection of peer {}", log_pubkey!(node_id)); + let logger = WithContext::from(&self.logger, Some(node_id), None, None); + log_trace!(logger, "Handling disconnection of peer {} because {}", log_pubkey!(node_id), reason); let removed = self.node_id_to_descriptor.lock().unwrap().remove(&node_id); debug_assert!(removed.is_some(), "descriptor maps should be consistent"); if !peer.handshake_complete() { return; }