Skip to content

Commit 6d6b07c

Browse files
committed
Validate negative splice_init.funding_contribution_satoshis
From BOLT #2: ``` - If `funding_contribution_satoshis` is negative and its absolute value is greater than the sending node's current channel balance: - MUST send a `warning` and close the connection or send an `error` and fail the channel. ``` We allow the remote to be below the new reserve as long as their funding contribution is not negative; we don't care whether they were above or below the previous funding reserve.
1 parent 4d5665c commit 6d6b07c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lightning/src/ln/channel.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10748,7 +10748,9 @@ where
1074810748
// Note on channel reserve requirement pre-check: as the splice acceptor does not contribute,
1074910749
// it can't go below reserve, therefore no pre-check is done here.
1075010750

10751-
// TODO(splicing): Early check for reserve requirement
10751+
if their_funding_contribution_satoshis.is_negative() {
10752+
self.validate_their_negative_funding_contribution(&splice_funding)?;
10753+
}
1075210754

1075310755
Ok(splice_funding)
1075410756
}

0 commit comments

Comments
 (0)