Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lightning/src/ln/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11602,10 +11602,10 @@ where
});
}

if !self.context.is_live() {
if !self.context.is_usable() {
return Err(APIError::APIMisuseError {
err: format!(
"Channel {} cannot be spliced, as channel is not live",
"Channel {} cannot be spliced as it is either pending open/close",
self.context.channel_id()
),
});
Expand Down Expand Up @@ -12751,13 +12751,15 @@ where
|| self.context.channel_state.is_awaiting_quiescence()
|| self.context.channel_state.is_local_stfu_sent()
{
log_info!(logger, "Channel is either pending or already quiescent");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is meant by "pending" here? Shouldn't we only be able to reach here if the channel is funded?

return Ok(None);
}

self.context.channel_state.set_awaiting_quiescence();
if self.context.is_live() {
Ok(Some(self.send_stfu(logger)?))
} else {
log_info!(logger, "Waiting for peer reconnection to send stfu");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this log and the one above be debug given that is what is used at the start of the method? Without that context these messages might be unclear.

Ok(None)
}
}
Expand Down
8 changes: 0 additions & 8 deletions lightning/src/ln/channelmanager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4682,14 +4682,6 @@ where
// Look for the channel
match peer_state.channel_by_id.entry(*channel_id) {
hash_map::Entry::Occupied(mut chan_phase_entry) => {
if !chan_phase_entry.get().context().is_connected() {
// TODO: We should probably support this, but right now `splice_channel` refuses when
// the peer is disconnected, so we just check it here.
return Err(APIError::ChannelUnavailable {
err: "Cannot initiate splice while peer is disconnected".to_owned(),
});
}

let locktime = locktime.unwrap_or_else(|| self.current_best_block().height);
if let Some(chan) = chan_phase_entry.get_mut().as_funded_mut() {
let logger = WithChannelContext::from(&self.logger, &chan.context, None);
Expand Down