Skip to content

Commit e3c1a6b

Browse files
committed
f - correctly adjust contribution for fees
1 parent bb7b9c8 commit e3c1a6b

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
@@ -10734,7 +10734,7 @@ where
1073410734
// by the funding inputs.
1073510735
let adjusted_funding_contribution = if our_funding_contribution < SignedAmount::ZERO {
1073610736
let adjusted_funding_contribution = our_funding_contribution
10737-
+ fees.to_signed().expect("fees should never exceed splice-out value");
10737+
- fees.to_signed().expect("fees should never exceed splice-out value");
1073810738

1073910739
// TODO(splicing): Check that channel balance does not go below the channel reserve
1074010740
let _post_channel_balance = AddSigned::checked_add_signed(
@@ -10792,7 +10792,7 @@ where
1079210792

1079310793
Ok(msgs::SpliceInit {
1079410794
channel_id: self.context.channel_id,
10795-
funding_contribution_satoshis: our_funding_contribution.to_sat(),
10795+
funding_contribution_satoshis: adjusted_funding_contribution.to_sat(),
1079610796
funding_feerate_per_kw,
1079710797
locktime,
1079810798
funding_pubkey,

0 commit comments

Comments
 (0)