Skip to content

Commit be49458

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 1516d84 commit be49458

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),
@@ -10802,12 +10798,10 @@ where
1080210798
self.funding.get_value_satoshis(),
1080310799
);
1080410800

10805-
let their_funding_contribution_satoshis = msg.funding_contribution_satoshis;
1080610801
let prev_funding_input = self.funding.to_splice_funding_input();
1080710802
let funding_negotiation_context = FundingNegotiationContext {
1080810803
is_initiator: false,
1080910804
our_funding_contribution,
10810-
their_funding_contribution_satoshis: Some(their_funding_contribution_satoshis),
1081110805
funding_tx_locktime: LockTime::from_consensus(msg.locktime),
1081210806
funding_feerate_sat_per_1000_weight: msg.funding_feerate_per_kw,
1081310807
shared_funding_input: Some(prev_funding_input),
@@ -12506,8 +12500,6 @@ where
1250612500
let funding_negotiation_context = FundingNegotiationContext {
1250712501
is_initiator: true,
1250812502
our_funding_contribution: SignedAmount::from_sat(funding_satoshis as i64),
12509-
// TODO(dual_funding) TODO(splicing) Include counterparty contribution, once that's enabled
12510-
their_funding_contribution_satoshis: None,
1251112503
funding_tx_locktime,
1251212504
funding_feerate_sat_per_1000_weight,
1251312505
shared_funding_input: None,
@@ -12662,7 +12654,6 @@ where
1266212654
let funding_negotiation_context = FundingNegotiationContext {
1266312655
is_initiator: false,
1266412656
our_funding_contribution,
12665-
their_funding_contribution_satoshis: Some(msg.common_fields.funding_satoshis as i64),
1266612657
funding_tx_locktime: LockTime::from_consensus(msg.locktime),
1266712658
funding_feerate_sat_per_1000_weight: msg.funding_feerate_sat_per_1000_weight,
1266812659
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)