Skip to content

Commit 8e00cb2

Browse files
committed
f - add missed their_funding_contribution check
1 parent 11bd6d8 commit 8e00cb2

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

lightning/src/ln/channel.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11008,8 +11008,16 @@ where
1100811008

1100911009
let their_funding_contribution = SignedAmount::from_sat(msg.funding_contribution_satoshis);
1101011010
if their_funding_contribution > SignedAmount::MAX_MONEY {
11011-
return Err(ChannelError::Warn(format!(
11012-
"Channel {} cannot be spliced; their contribution exceeds total bitcoin supply: {}",
11011+
return Err(ChannelError::WarnAndDisconnect(format!(
11012+
"Channel {} cannot be spliced in; their {} contribution exceeds the total bitcoin supply",
11013+
self.context.channel_id(),
11014+
their_funding_contribution,
11015+
)));
11016+
}
11017+
11018+
if their_funding_contribution < -SignedAmount::MAX_MONEY {
11019+
return Err(ChannelError::WarnAndDisconnect(format!(
11020+
"Channel {} cannot be spliced out; their {} contribution exhausts the total bitcoin supply",
1101311021
self.context.channel_id(),
1101411022
their_funding_contribution,
1101511023
)));

0 commit comments

Comments
 (0)