Skip to content

Commit 1993ec0

Browse files
committed
Always send Shutdown resposnes to Shutdown messages
We always require that any changes to Channel state be committed immediately (within the same lock) so we should never have uncommitted changes which would prevent us from sending a Shutdown response.
1 parent 7bb598e commit 1993ec0

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/ln/channel.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2446,11 +2446,9 @@ impl Channel {
24462446
_ => true
24472447
}
24482448
});
2449-
for htlc in self.pending_outbound_htlcs.iter() {
2450-
if let OutboundHTLCState::LocalAnnounced(_) = htlc.state {
2451-
return Ok((None, None, dropped_outbound_htlcs));
2452-
}
2453-
}
2449+
// If we have any LocalAnnounced updates we'll probably just get back a update_fail_htlc
2450+
// immediately after the commitment dance, but we can send a Shutdown cause we won't send
2451+
// any further commitment updates after we set LocalShutdownSent.
24542452

24552453
let our_shutdown = if (self.channel_state & ChannelState::LocalShutdownSent as u32) == ChannelState::LocalShutdownSent as u32 {
24562454
None

0 commit comments

Comments
 (0)