Skip to content

Commit 4f666a0

Browse files
committed
Enforce that the splice initiator set a non-zero funding contribution
1 parent 55d2770 commit 4f666a0

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
@@ -11110,6 +11110,13 @@ where
1111011110
}
1111111111

1111211112
let their_funding_contribution = SignedAmount::from_sat(msg.funding_contribution_satoshis);
11113+
if their_funding_contribution == SignedAmount::ZERO {
11114+
return Err(ChannelError::WarnAndDisconnect(format!(
11115+
"Channel {} cannot be spliced; they are the initiator, and their contribution is zero",
11116+
self.context.channel_id(),
11117+
)));
11118+
}
11119+
1111311120
self.validate_splice_contribution(their_funding_contribution)?;
1111411121

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

0 commit comments

Comments
 (0)