Skip to content

Commit 1edde0d

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 4ef8d92 commit 1edde0d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lightning/src/ln/channel.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4894,6 +4894,12 @@ impl<SP: Deref> Channel<SP> where
48944894
return None;
48954895
}
48964896

4897+
// If we're still pending the signature on a funding transaction, then we're not ready to send a
4898+
// channel_ready yet.
4899+
if self.context.signer_pending_funding {
4900+
return None;
4901+
}
4902+
48974903
// Note that we don't include ChannelState::WaitingForBatch as we don't want to send
48984904
// channel_ready until the entire batch is ready.
48994905
let non_shutdown_state = self.context.channel_state & (!MULTI_STATE_FLAGS);
@@ -6831,7 +6837,7 @@ impl<SP: Deref> InboundV1Channel<SP> where SP::Target: SignerProvider {
68316837
context: self.context,
68326838
};
68336839

6834-
let need_channel_ready = funding_signed.is_some() && channel.check_get_channel_ready(0).is_some();
6840+
let need_channel_ready = channel.check_get_channel_ready(0).is_some();
68356841
channel.monitor_updating_paused(false, false, need_channel_ready, Vec::new(), Vec::new(), Vec::new());
68366842

68376843
Ok((channel, funding_signed, channel_monitor))

0 commit comments

Comments
 (0)