Skip to content

Commit e9fed49

Browse files
committed
Disallow duplicate Init messages from peers
1 parent bf46a5f commit e9fed49

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/ln/peer_handler.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,9 @@ impl<Descriptor: SocketDescriptor> PeerManager<Descriptor> {
445445
if msg.local_features.requires_unknown_bits() {
446446
return Err(PeerHandleError{ no_connection_possible: true });
447447
}
448+
if peer.their_global_features.is_some() {
449+
return Err(PeerHandleError{ no_connection_possible: false });
450+
}
448451
peer.their_global_features = Some(msg.global_features);
449452
peer.their_local_features = Some(msg.local_features);
450453

0 commit comments

Comments
 (0)