From e9fed4973b64c93834bd5b277347cbe7d5279726 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Sat, 8 Sep 2018 14:43:15 -0400 Subject: [PATCH] Disallow duplicate Init messages from peers --- src/ln/peer_handler.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ln/peer_handler.rs b/src/ln/peer_handler.rs index 3d3588a4d..8a4228851 100644 --- a/src/ln/peer_handler.rs +++ b/src/ln/peer_handler.rs @@ -445,6 +445,9 @@ impl PeerManager { if msg.local_features.requires_unknown_bits() { return Err(PeerHandleError{ no_connection_possible: true }); } + if peer.their_global_features.is_some() { + return Err(PeerHandleError{ no_connection_possible: false }); + } peer.their_global_features = Some(msg.global_features); peer.their_local_features = Some(msg.local_features); -- 2.39.5