Skip to content

Commit 8b832ba

Browse files
committed
Remove their_funding_contribution_satoshis from FundingNegotiationContext
Once the counterparty supplies their funding contribution, there is no longer a need to store it in FundingNegotiationContext as it will have already been used to create a FundingScope.
1 parent deec54c commit 8b832ba

File tree

2 files changed

+0
-10
lines changed

2 files changed

+0
-10
lines changed

lightning/src/ln/channel.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5968,9 +5968,6 @@ pub(super) struct FundingNegotiationContext {
59685968
pub is_initiator: bool,
59695969
/// The amount in satoshis we will be contributing to the channel.
59705970
pub our_funding_contribution: SignedAmount,
5971-
/// The amount in satoshis our counterparty will be contributing to the channel.
5972-
#[allow(dead_code)] // TODO(dual_funding): Remove once contribution to V2 channels is enabled.
5973-
pub their_funding_contribution_satoshis: Option<i64>,
59745971
/// The funding transaction locktime suggested by the initiator. If set by us, it is always set
59755972
/// to the current block height to align incentives against fee-sniping.
59765973
pub funding_tx_locktime: LockTime,
@@ -10691,7 +10688,6 @@ where
1069110688
let funding_negotiation_context = FundingNegotiationContext {
1069210689
is_initiator: true,
1069310690
our_funding_contribution,
10694-
their_funding_contribution_satoshis: None,
1069510691
funding_tx_locktime: LockTime::from_consensus(locktime),
1069610692
funding_feerate_sat_per_1000_weight: funding_feerate_per_kw,
1069710693
shared_funding_input: Some(prev_funding_input),
@@ -10810,12 +10806,10 @@ where
1081010806
self.funding.get_value_satoshis(),
1081110807
);
1081210808

10813-
let their_funding_contribution_satoshis = msg.funding_contribution_satoshis;
1081410809
let prev_funding_input = self.funding.to_splice_funding_input();
1081510810
let funding_negotiation_context = FundingNegotiationContext {
1081610811
is_initiator: false,
1081710812
our_funding_contribution,
10818-
their_funding_contribution_satoshis: Some(their_funding_contribution_satoshis),
1081910813
funding_tx_locktime: LockTime::from_consensus(msg.locktime),
1082010814
funding_feerate_sat_per_1000_weight: msg.funding_feerate_per_kw,
1082110815
shared_funding_input: Some(prev_funding_input),
@@ -12514,8 +12508,6 @@ where
1251412508
let funding_negotiation_context = FundingNegotiationContext {
1251512509
is_initiator: true,
1251612510
our_funding_contribution: SignedAmount::from_sat(funding_satoshis as i64),
12517-
// TODO(dual_funding) TODO(splicing) Include counterparty contribution, once that's enabled
12518-
their_funding_contribution_satoshis: None,
1251912511
funding_tx_locktime,
1252012512
funding_feerate_sat_per_1000_weight,
1252112513
shared_funding_input: None,
@@ -12670,7 +12662,6 @@ where
1267012662
let funding_negotiation_context = FundingNegotiationContext {
1267112663
is_initiator: false,
1267212664
our_funding_contribution,
12673-
their_funding_contribution_satoshis: Some(msg.common_fields.funding_satoshis as i64),
1267412665
funding_tx_locktime: LockTime::from_consensus(msg.locktime),
1267512666
funding_feerate_sat_per_1000_weight: msg.funding_feerate_sat_per_1000_weight,
1267612667
shared_funding_input: None,

lightning/src/ln/interactivetxs.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2995,7 +2995,6 @@ mod tests {
29952995
let context = FundingNegotiationContext {
29962996
is_initiator: true,
29972997
our_funding_contribution: SignedAmount::from_sat(our_contributed as i64),
2998-
their_funding_contribution_satoshis: None,
29992998
funding_tx_locktime: AbsoluteLockTime::ZERO,
30002999
funding_feerate_sat_per_1000_weight,
30013000
shared_funding_input: None,

0 commit comments

Comments
 (0)