Skip to content

Commit b5cf08d

Browse files
committed
Enforce that the splice initiator set a non-zero funding contribution
1 parent 917ee4a commit b5cf08d

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
@@ -11302,6 +11302,13 @@ where
1130211302
}
1130311303

1130411304
let their_funding_contribution = SignedAmount::from_sat(msg.funding_contribution_satoshis);
11305+
if their_funding_contribution == SignedAmount::ZERO {
11306+
return Err(ChannelError::WarnAndDisconnect(format!(
11307+
"Channel {} cannot be spliced; they are the initiator, and their contribution is zero",
11308+
self.context.channel_id(),
11309+
)));
11310+
}
11311+
1130511312
self.validate_splice_contribution(their_funding_contribution)?;
1130611313

1130711314
// TODO(splicing): Check that channel balance does not go below the channel reserve

0 commit comments

Comments
 (0)