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=refs%2Fheads%2F2018-09-channel-connection-cleanups;p=rust-lightning Disallow duplicate Init messages from peers --- 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);