projects
/
rust-lightning
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bf46a5f
)
Disallow duplicate Init messages from peers
2018-09-channel-connection-cleanups
author
Matt Corallo
<git@bluematt.me>
Sat, 8 Sep 2018 18:43:15 +0000
(14:43 -0400)
committer
Matt Corallo
<git@bluematt.me>
Sat, 8 Sep 2018 18:43:42 +0000
(14:43 -0400)
src/ln/peer_handler.rs
patch
|
blob
|
history
diff --git
a/src/ln/peer_handler.rs
b/src/ln/peer_handler.rs
index 3d3588a4d8d9056bfa731f445bd77ef963ac98f8..8a4228851b7a7e3981e698ccc6cd05f3cb3e5d3b 100644
(file)
--- a/
src/ln/peer_handler.rs
+++ b/
src/ln/peer_handler.rs
@@
-445,6
+445,9
@@
impl<Descriptor: SocketDescriptor> PeerManager<Descriptor> {
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);