Skip to content

Commit e42bed3

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 186068d commit e42bed3

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
@@ -5967,9 +5967,6 @@ pub(super) struct FundingNegotiationContext {
59675967
pub is_initiator: bool,
59685968
/// The amount in satoshis we will be contributing to the channel.
59695969
pub our_funding_contribution: SignedAmount,
5970-
/// The amount in satoshis our counterparty will be contributing to the channel.
5971-
#[allow(dead_code)] // TODO(dual_funding): Remove once contribution to V2 channels is enabled.
5972-
pub their_funding_contribution_satoshis: Option<i64>,
59735970
/// The funding transaction locktime suggested by the initiator. If set by us, it is always set
59745971
/// to the current block height to align incentives against fee-sniping.
59755972
pub funding_tx_locktime: LockTime,
@@ -10683,7 +10680,6 @@ where
1068310680
let funding_negotiation_context = FundingNegotiationContext {
1068410681
is_initiator: true,
1068510682
our_funding_contribution,
10686-
their_funding_contribution_satoshis: None,
1068710683
funding_tx_locktime: LockTime::from_consensus(locktime),
1068810684
funding_feerate_sat_per_1000_weight: funding_feerate_per_kw,
1068910685
shared_funding_input: Some(prev_funding_input),
@@ -10804,12 +10800,10 @@ where
1080410800
self.funding.get_value_satoshis(),
1080510801
);
1080610802

10807-
let their_funding_contribution_satoshis = msg.funding_contribution_satoshis;
1080810803
let prev_funding_input = self.funding.to_splice_funding_input();
1080910804
let funding_negotiation_context = FundingNegotiationContext {
1081010805
is_initiator: false,
1081110806
our_funding_contribution,
10812-
their_funding_contribution_satoshis: Some(their_funding_contribution_satoshis),
1081310807
funding_tx_locktime: LockTime::from_consensus(msg.locktime),
1081410808
funding_feerate_sat_per_1000_weight: msg.funding_feerate_per_kw,
1081510809
shared_funding_input: Some(prev_funding_input),
@@ -12508,8 +12502,6 @@ where
1250812502
let funding_negotiation_context = FundingNegotiationContext {
1250912503
is_initiator: true,
1251012504
our_funding_contribution: SignedAmount::from_sat(funding_satoshis as i64),
12511-
// TODO(dual_funding) TODO(splicing) Include counterparty contribution, once that's enabled
12512-
their_funding_contribution_satoshis: None,
1251312505
funding_tx_locktime,
1251412506
funding_feerate_sat_per_1000_weight,
1251512507
shared_funding_input: None,
@@ -12664,7 +12656,6 @@ where
1266412656
let funding_negotiation_context = FundingNegotiationContext {
1266512657
is_initiator: false,
1266612658
our_funding_contribution,
12667-
their_funding_contribution_satoshis: Some(msg.common_fields.funding_satoshis as i64),
1266812659
funding_tx_locktime: LockTime::from_consensus(msg.locktime),
1266912660
funding_feerate_sat_per_1000_weight: msg.funding_feerate_sat_per_1000_weight,
1267012661
shared_funding_input: None,

lightning/src/ln/interactivetxs.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3188,7 +3188,6 @@ mod tests {
31883188
let context = FundingNegotiationContext {
31893189
is_initiator: true,
31903190
our_funding_contribution: SignedAmount::from_sat(our_contributed as i64),
3191-
their_funding_contribution_satoshis: None,
31923191
funding_tx_locktime: AbsoluteLockTime::ZERO,
31933192
funding_feerate_sat_per_1000_weight,
31943193
shared_funding_input: None,

0 commit comments

Comments
 (0)