File tree 2 files changed +12
-0
lines changed
2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -3550,6 +3550,12 @@ impl<Signer: Sign> Channel<Signer> {
3550
3550
return ;
3551
3551
}
3552
3552
3553
+ if self . channel_state & ( ChannelState :: PeerDisconnected as u32 ) == ( ChannelState :: PeerDisconnected as u32 ) {
3554
+ // While the below code should be idempotent, its simpler to just return early, as
3555
+ // redundant disconnect events can fire, though they should be rare.
3556
+ return ;
3557
+ }
3558
+
3553
3559
if self . announcement_sigs_state == AnnouncementSigsState :: MessageSent || self . announcement_sigs_state == AnnouncementSigsState :: Committed {
3554
3560
self . announcement_sigs_state = AnnouncementSigsState :: NotSent ;
3555
3561
}
Original file line number Diff line number Diff line change @@ -883,6 +883,9 @@ pub trait ChannelMessageHandler : MessageSendEventsProvider {
883
883
/// is believed to be possible in the future (eg they're sending us messages we don't
884
884
/// understand or indicate they require unknown feature bits), no_connection_possible is set
885
885
/// and any outstanding channels should be failed.
886
+ ///
887
+ /// Note that in some rare cases this may be called without a corresponding
888
+ /// [`Self::peer_connected`].
886
889
fn peer_disconnected ( & self , their_node_id : & PublicKey , no_connection_possible : bool ) ;
887
890
888
891
/// Handle a peer reconnecting, possibly generating channel_reestablish message(s).
@@ -979,6 +982,9 @@ pub trait OnionMessageHandler : OnionMessageProvider {
979
982
fn peer_connected ( & self , their_node_id : & PublicKey , init : & Init ) ;
980
983
/// Indicates a connection to the peer failed/an existing connection was lost. Allows handlers to
981
984
/// drop and refuse to forward onion messages to this peer.
985
+ ///
986
+ /// Note that in some rare cases this may be called without a corresponding
987
+ /// [`Self::peer_connected`].
982
988
fn peer_disconnected ( & self , their_node_id : & PublicKey , no_connection_possible : bool ) ;
983
989
984
990
// Handler information:
You can’t perform that action at this time.
0 commit comments