From: Matt Corallo Date: Sat, 8 Sep 2018 18:43:15 +0000 (-0400) Subject: Disallow duplicate Init messages from peers X-Git-Tag: v0.0.12~319^2 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=e9fed4973b64c93834bd5b277347cbe7d5279726;p=rust-lightning Disallow duplicate Init messages from peers --- diff --git a/src/ln/peer_handler.rs b/src/ln/peer_handler.rs index 3d3588a4..8a422885 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);