Skip to content

Commit

Permalink
Don't return a channel_ready event if funding is pending
Browse files Browse the repository at this point in the history
Per discussion, make it so that `check_get_channel_ready` returns `None` if
we're still pending a signature on a funding message.
  • Loading branch information
waterson committed Oct 10, 2023
1 parent b3a4d97 commit 73a1cc3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lightning/src/ln/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4878,6 +4878,12 @@ impl<SP: Deref> Channel<SP> where
return None;
}

// If we're still pending the signature on a funding transaction, then we're not ready to send a
// channel_ready yet.
if self.context.signer_pending_funding {
return None;
}

// Note that we don't include ChannelState::WaitingForBatch as we don't want to send
// channel_ready until the entire batch is ready.
let non_shutdown_state = self.context.channel_state & (!MULTI_STATE_FLAGS);
Expand Down Expand Up @@ -6810,7 +6816,7 @@ impl<SP: Deref> InboundV1Channel<SP> where SP::Target: SignerProvider {
context: self.context,
};

let need_channel_ready = funding_signed.is_some() && channel.check_get_channel_ready(0).is_some();
let need_channel_ready = channel.check_get_channel_ready(0).is_some();
channel.monitor_updating_paused(false, false, need_channel_ready, Vec::new(), Vec::new(), Vec::new());

Ok((channel, funding_signed, channel_monitor))
Expand Down

0 comments on commit 73a1cc3

Please sign in to comment.