From: Jeffrey Czyz Date: Thu, 18 Jan 2024 21:34:19 +0000 (-0600) Subject: Fix panic when peer is mid-handshake X-Git-Tag: v0.0.121~2^2~1 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=c7465bdb3e138def94f77848671567b24991345b;p=rust-lightning Fix panic when peer is mid-handshake Peer::their_node_id is set to Some during the handshake process. However, df3ab2ee2753e7f9ec02ddf1c8a51db77c50e35d accesses the field unconditionally, causing a panic. This may be triggered if a gossip message is received mid-handshake from another peer or if the user calls broadcast_node_announcement during this time. The latter tends to be executed on a timer. Ensure that Peer::their_node_id is only accessed once the handshake is complete. --- diff --git a/lightning/src/ln/peer_handler.rs b/lightning/src/ln/peer_handler.rs index 6d46558b1..100446f05 100644 --- a/lightning/src/ln/peer_handler.rs +++ b/lightning/src/ln/peer_handler.rs @@ -1835,13 +1835,13 @@ impl