Skip to content

Commit a4f2c36

Browse files
committed
Relax OnionMessenger::peer_disconnected assertion
When a peer is connected, OnionMessenger tracks it only if it supports onion messages. On disconnect, we debug_assert that the peer was in a state ConnectedPeer, failing when it is in the PendingConnection state. However, we were mistakenly asserting for peers that we were not tracking (i.e., that don't support onion messages). Relax the check to not fail on the latter.
1 parent 0c67753 commit a4f2c36

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lightning/src/onion_message/messenger.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,8 @@ where
914914
fn peer_disconnected(&self, their_node_id: &PublicKey) {
915915
match self.message_recipients.lock().unwrap().remove(their_node_id) {
916916
Some(OnionMessageRecipient::ConnectedPeer(..)) => {},
917-
_ => debug_assert!(false),
917+
Some(_) => debug_assert!(false),
918+
None => {},
918919
}
919920
}
920921

0 commit comments

Comments
 (0)