From 9fa6e3c6a042353cb7d00a98d9d04fb744f2328b Mon Sep 17 00:00:00 2001 From: Jeffrey Czyz Date: Mon, 25 Aug 2025 17:12:44 -0500 Subject: [PATCH 1/2] Fix debug_assert on our_funding_contribution When processing a splice_ack, the debug_assert on the range of our_funding_contribution should account for values that are for both positive (splice-in) and negative (splice-out). --- lightning/src/ln/channel.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lightning/src/ln/channel.rs b/lightning/src/ln/channel.rs index a04b603253b..59062b8c424 100644 --- a/lightning/src/ln/channel.rs +++ b/lightning/src/ln/channel.rs @@ -11019,7 +11019,7 @@ where }; let our_funding_contribution = funding_negotiation_context.our_funding_contribution; - debug_assert!(our_funding_contribution <= SignedAmount::MAX_MONEY); + debug_assert!(our_funding_contribution.abs() <= SignedAmount::MAX_MONEY); let their_funding_contribution = SignedAmount::from_sat(msg.funding_contribution_satoshis); self.validate_splice_contribution(their_funding_contribution)?; From 8213f65d7e0a2cf77f100263db0adf7966719bce Mon Sep 17 00:00:00 2001 From: Jeffrey Czyz Date: Mon, 25 Aug 2025 17:22:06 -0500 Subject: [PATCH 2/2] Include fees in SpliceContribution docs How fees are paid for in a SpliceContribution depends on whether it is a SpliceIn or SpliceOut. Include this in its docs for clarification. --- lightning/src/ln/funding.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lightning/src/ln/funding.rs b/lightning/src/ln/funding.rs index 8a517419040..e42c338d865 100644 --- a/lightning/src/ln/funding.rs +++ b/lightning/src/ln/funding.rs @@ -24,8 +24,8 @@ pub enum SpliceContribution { /// The amount to contribute to the splice. value: Amount, - /// The inputs included in the splice's funding transaction to meet the contributed amount. - /// Any excess amount will be sent to a change output. + /// The inputs included in the splice's funding transaction to meet the contributed amount + /// plus fees. Any excess amount will be sent to a change output. inputs: Vec, /// An optional change output script. This will be used if needed or, when not set, @@ -35,7 +35,7 @@ pub enum SpliceContribution { /// When funds are removed from a channel. SpliceOut { /// The outputs to include in the splice's funding transaction. The total value of all - /// outputs will be the amount that is removed. + /// outputs plus fees will be the amount that is removed. outputs: Vec, }, }