Skip to content

Commit 3245114

Browse files
committed
Add check for shutdown-received
1 parent 614c5db commit 3245114

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lightning/src/ln/channel.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8190,6 +8190,13 @@ impl<SP: Deref> FundedChannel<SP> where
81908190
return Err(ChannelError::Warn(format!("Splicing requested on a channel that is not Ready")));
81918191
}
81928192

8193+
// - If it has received shutdown:
8194+
// MUST send a warning and close the connection or send an error
8195+
// and fail the channel.
8196+
if self.context.channel_state.is_remote_shutdown_sent() {
8197+
return Err(ChannelError::close("Got splice_init when channel was not in an operational state".to_owned()));
8198+
}
8199+
81938200
let pre_channel_value = self.context.get_value_satoshis();
81948201
// Sanity check: capacity cannot decrease below 0
81958202
if (pre_channel_value as i64)

0 commit comments

Comments
 (0)