]> git.bitcoin.ninja Git - rust-lightning/commit
Relax OnionMessenger::peer_disconnected assertion
authorJeffrey Czyz <jkczyz@gmail.com>
Tue, 12 Dec 2023 14:46:10 +0000 (08:46 -0600)
committerJeffrey Czyz <jkczyz@gmail.com>
Tue, 12 Dec 2023 14:53:52 +0000 (08:53 -0600)
commita4f2c36015545c9607eb07a4bef5061997d2d322
treea2e278e891de2d18b7d0fcb2b0276a03ba45b605
parent0c677533fc3055163c1768ef2211fbf7317d65ab
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.
lightning/src/onion_message/messenger.rs