Skip to content

Commit 56ed8ba

Browse files
committed
f - correctly adjust contribution for fees
1 parent e8dd4b6 commit 56ed8ba

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lightning/src/ln/channel.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10742,7 +10742,7 @@ where
1074210742
// by the funding inputs.
1074310743
let adjusted_funding_contribution = if our_funding_contribution < SignedAmount::ZERO {
1074410744
let adjusted_funding_contribution = our_funding_contribution
10745-
+ fees.to_signed().expect("fees should never exceed splice-out value");
10745+
- fees.to_signed().expect("fees should never exceed splice-out value");
1074610746

1074710747
// TODO(splicing): Check that channel balance does not go below the channel reserve
1074810748
let _post_channel_balance = AddSigned::checked_add_signed(
@@ -10800,7 +10800,7 @@ where
1080010800

1080110801
Ok(msgs::SpliceInit {
1080210802
channel_id: self.context.channel_id,
10803-
funding_contribution_satoshis: our_funding_contribution.to_sat(),
10803+
funding_contribution_satoshis: adjusted_funding_contribution.to_sat(),
1080410804
funding_feerate_per_kw,
1080510805
locktime,
1080610806
funding_pubkey,

0 commit comments

Comments
 (0)