Skip to content

Commit 63d403a

Browse files
committed
Don't return a channel_ready event if funding is pending
Per discussion, make it so that `check_get_channel_ready` returns `None` if we're still pending a signature on a funding message.
1 parent e40ccd3 commit 63d403a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lightning/src/ln/channel.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -4878,6 +4878,12 @@ impl<SP: Deref> Channel<SP> where
48784878
return None;
48794879
}
48804880

4881+
// If we're still pending the signature on a funding transaction, then we're not ready to send a
4882+
// channel_ready yet.
4883+
if self.context.signer_pending_funding {
4884+
return None;
4885+
}
4886+
48814887
// Note that we don't include ChannelState::WaitingForBatch as we don't want to send
48824888
// channel_ready until the entire batch is ready.
48834889
let non_shutdown_state = self.context.channel_state & (!MULTI_STATE_FLAGS);
@@ -6810,7 +6816,7 @@ impl<SP: Deref> InboundV1Channel<SP> where SP::Target: SignerProvider {
68106816
context: self.context,
68116817
};
68126818

6813-
let need_channel_ready = funding_signed.is_some() && channel.check_get_channel_ready(0).is_some();
6819+
let need_channel_ready = channel.check_get_channel_ready(0).is_some();
68146820
channel.monitor_updating_paused(false, false, need_channel_ready, Vec::new(), Vec::new(), Vec::new());
68156821

68166822
Ok((channel, funding_signed, channel_monitor))

0 commit comments

Comments
 (0)