File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -11023,6 +11023,22 @@ where
1102311023 )));
1102411024 }
1102511025
11026+ let their_channel_balance = Amount::from_sat(self.funding.get_value_satoshis())
11027+ - Amount::from_sat(self.funding.get_value_to_self_msat() / 1000);
11028+ let post_channel_balance = AddSigned::checked_add_signed(
11029+ their_channel_balance.to_sat(),
11030+ their_funding_contribution.to_sat(),
11031+ );
11032+
11033+ if post_channel_balance.is_none() {
11034+ return Err(ChannelError::WarnAndDisconnect(format!(
11035+ "Channel {} cannot be spliced out; their {} contribution exhausts their channel balance: {}",
11036+ self.context.channel_id(),
11037+ their_funding_contribution,
11038+ their_channel_balance,
11039+ )));
11040+ }
11041+
1102611042 let splice_funding = FundingScope::for_splice(
1102711043 &self.funding,
1102811044 &self.context,
You can’t perform that action at this time.
0 commit comments