From 440129c6b6552b2c17852e13246a2561cb216ad2 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Mon, 24 Feb 2020 18:38:55 -0500 Subject: [PATCH] Add logging on receipt of unknown message types. This should make peer disconnection easier to debug. --- lightning/src/ln/peer_handler.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lightning/src/ln/peer_handler.rs b/lightning/src/ln/peer_handler.rs index 8aff2fc56..049aae701 100644 --- a/lightning/src/ln/peer_handler.rs +++ b/lightning/src/ln/peer_handler.rs @@ -755,10 +755,13 @@ impl PeerManager where // Unknown messages: wire::Message::Unknown(msg_type) if msg_type.is_even() => { + log_debug!(self, "Received unknown even message of type {}, disconnecting peer!", msg_type); // Fail the channel if message is an even, unknown type as per BOLT #1. return Err(PeerHandleError{ no_connection_possible: true }); }, - wire::Message::Unknown(_) => {}, + wire::Message::Unknown(msg_type) => { + log_trace!(self, "Received unknown odd message of type {}, ignoring", msg_type); + }, } } } -- 2.39.5