Skip to content

Commit

Permalink
Add check for shutdown-received
Browse files Browse the repository at this point in the history
  • Loading branch information
optout21 committed Jan 23, 2025
1 parent 614c5db commit 3245114
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lightning/src/ln/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8190,6 +8190,13 @@ impl<SP: Deref> FundedChannel<SP> where
return Err(ChannelError::Warn(format!("Splicing requested on a channel that is not Ready")));
}

// - If it has received shutdown:
// MUST send a warning and close the connection or send an error
// and fail the channel.
if self.context.channel_state.is_remote_shutdown_sent() {
return Err(ChannelError::close("Got splice_init when channel was not in an operational state".to_owned()));
}

let pre_channel_value = self.context.get_value_satoshis();
// Sanity check: capacity cannot decrease below 0
if (pre_channel_value as i64)
Expand Down

0 comments on commit 3245114

Please sign in to comment.