]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Check funding transaction on outbound channels only
authorWilmer Paulino <wilmer@wilmerpaulino.com>
Fri, 8 Dec 2023 18:23:13 +0000 (10:23 -0800)
committerWilmer Paulino <wilmer@wilmerpaulino.com>
Thu, 11 Jan 2024 02:29:00 +0000 (18:29 -0800)
This was a slight regression, but not a critical one. Only outbound
channels should have a funding transaction present.

lightning/src/ln/channel.rs

index e77f502d1edb57230e83d3fc0aa15898e3c19cdd..f37b2c1104f545e61cdf517f4503baf64a52a5ca 100644 (file)
@@ -4176,8 +4176,8 @@ impl<SP: Deref> Channel<SP> where
                // first received the funding_signed.
                let mut funding_broadcastable =
                        if self.context.is_outbound() &&
-                               matches!(self.context.channel_state, ChannelState::AwaitingChannelReady(flags) if !flags.is_set(AwaitingChannelReadyFlags::WAITING_FOR_BATCH)) ||
-                               matches!(self.context.channel_state, ChannelState::ChannelReady(_))
+                               (matches!(self.context.channel_state, ChannelState::AwaitingChannelReady(flags) if !flags.is_set(AwaitingChannelReadyFlags::WAITING_FOR_BATCH)) ||
+                               matches!(self.context.channel_state, ChannelState::ChannelReady(_)))
                        {
                                self.context.funding_transaction.take()
                        } else { None };