From: Matt Corallo Date: Tue, 30 Oct 2018 19:53:34 +0000 (-0400) Subject: Always send Shutdown resposnes to Shutdown messages X-Git-Tag: v0.0.12~278^2~5 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=1993ec0d12c7503131dbb4564d6dbce29fbf1ff0;p=rust-lightning 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. --- diff --git a/src/ln/channel.rs b/src/ln/channel.rs index ba8d1533d..33e09448f 100644 --- a/src/ln/channel.rs +++ b/src/ln/channel.rs @@ -2446,11 +2446,9 @@ impl Channel { _ => true } }); - for htlc in self.pending_outbound_htlcs.iter() { - if let OutboundHTLCState::LocalAnnounced(_) = htlc.state { - return Ok((None, None, dropped_outbound_htlcs)); - } - } + // If we have any LocalAnnounced updates we'll probably just get back a update_fail_htlc + // immediately after the commitment dance, but we can send a Shutdown cause we won't send + // any further commitment updates after we set LocalShutdownSent. let our_shutdown = if (self.channel_state & ChannelState::LocalShutdownSent as u32) == ChannelState::LocalShutdownSent as u32 { None