From: Matt Corallo Date: Mon, 24 Feb 2020 23:38:55 +0000 (-0500) Subject: Add logging on receipt of unknown message types. X-Git-Tag: v0.0.12~117^2~1 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=440129c6b6552b2c17852e13246a2561cb216ad2;p=rust-lightning Add logging on receipt of unknown message types. This should make peer disconnection easier to debug. --- 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); + }, } } }