Skip to content

Commit f1116a9

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 ebd86b0 commit f1116a9

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
@@ -2405,11 +2405,9 @@ impl Channel {
24052405
_ => true
24062406
}
24072407
});
2408-
for htlc in self.pending_outbound_htlcs.iter() {
2409-
if let OutboundHTLCState::LocalAnnounced(_) = htlc.state {
2410-
return Ok((None, None, dropped_outbound_htlcs));
2411-
}
2412-
}
2408+
// If we have any LocalAnnounced updates we'll probably just get back a update_fail_htlc
2409+
// immediately after the commitment dance, but we can send a Shutdown cause we won't send
2410+
// any further commitment updates after we set LocalShutdownSent.
24132411

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

0 commit comments

Comments
 (0)