Skip to content

Commit a1954d7

Browse files
committed
Add check for shutdown-received
1 parent c73b56c commit a1954d7

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
@@ -8441,6 +8441,13 @@ impl<SP: Deref> FundedChannel<SP> where
84418441
return Err(ChannelError::Warn(format!("Splicing requested on a channel that is not Ready")));
84428442
}
84438443

8444+
// - If it has received shutdown:
8445+
// MUST send a warning and close the connection or send an error
8446+
// and fail the channel.
8447+
if self.context.channel_state.is_remote_shutdown_sent() {
8448+
return Err(ChannelError::close("Got splice_init when channel was not in an operational state".to_owned()));
8449+
}
8450+
84448451
let pre_channel_value = self.funding.get_value_satoshis();
84458452
// Sanity check: capacity cannot decrease below 0
84468453
if (pre_channel_value as i64)

0 commit comments

Comments
 (0)