@@ -2472,13 +2472,13 @@ impl<'a, SP: Deref> FundingTxConstructorV2<SP> for FundedChannelRefundingWrapper
2472
2472
}
2473
2473
2474
2474
#[inline]
2475
- fn dual_funding_context (&self) -> &DualFundingChannelContext {
2476
- &self.refunding_scope.pending_dual_funding_context
2475
+ fn funding_negotiation_context (&self) -> &FundingNegotiationContext {
2476
+ &self.refunding_scope.pending_funding_negotiation_context
2477
2477
}
2478
2478
2479
2479
#[inline]
2480
- fn dual_funding_context_mut (&mut self) -> &mut DualFundingChannelContext {
2481
- &mut self.refunding_scope.pending_dual_funding_context
2480
+ fn funding_negotiation_context_mut (&mut self) -> &mut FundingNegotiationContext {
2481
+ &mut self.refunding_scope.pending_funding_negotiation_context
2482
2482
}
2483
2483
2484
2484
fn transaction_number(&self) -> u64 {
@@ -2507,8 +2507,8 @@ pub(super) trait FundingTxConstructorV2<SP: Deref>: ChannelContextProvider<SP> w
2507
2507
fn pending_funding(&self) -> &FundingScope;
2508
2508
fn pending_funding_mut(&mut self) -> &mut FundingScope;
2509
2509
fn pending_funding_and_context_mut(&mut self) -> (&FundingScope, &mut ChannelContext<SP>);
2510
- fn dual_funding_context (&self) -> &DualFundingChannelContext ;
2511
- fn dual_funding_context_mut (&mut self) -> &mut DualFundingChannelContext ;
2510
+ fn funding_negotiation_context (&self) -> &FundingNegotiationContext ;
2511
+ fn funding_negotiation_context_mut (&mut self) -> &mut FundingNegotiationContext ;
2512
2512
fn transaction_number(&self) -> u64;
2513
2513
fn interactive_tx_constructor(&self) -> Option<&InteractiveTxConstructor>;
2514
2514
fn interactive_tx_constructor_mut(&mut self) -> &mut Option<InteractiveTxConstructor>;
@@ -2535,8 +2535,8 @@ pub(super) trait FundingTxConstructorV2<SP: Deref>: ChannelContextProvider<SP> w
2535
2535
debug_assert!(self.interactive_tx_constructor().is_none());
2536
2536
2537
2537
let mut funding_inputs = Vec::new();
2538
- let dual_funding_context_mut = self.dual_funding_context_mut ();
2539
- mem::swap(&mut dual_funding_context_mut .our_funding_inputs, &mut funding_inputs);
2538
+ let funding_negotiation_context_mut = self.funding_negotiation_context_mut ();
2539
+ mem::swap(&mut funding_negotiation_context_mut .our_funding_inputs, &mut funding_inputs);
2540
2540
2541
2541
if let Some(prev_funding_input) = prev_funding_input {
2542
2542
funding_inputs.push(prev_funding_input);
@@ -2555,11 +2555,11 @@ pub(super) trait FundingTxConstructorV2<SP: Deref>: ChannelContextProvider<SP> w
2555
2555
script_pubkey: pending_funding.get_funding_redeemscript().to_p2wsh(),
2556
2556
};
2557
2557
2558
- let dual_funding_context = &self.dual_funding_context ();
2558
+ let funding_negotiation_context = &self.funding_negotiation_context ();
2559
2559
if pending_funding.is_outbound() {
2560
2560
funding_outputs.push(
2561
2561
OutputOwned::Shared(SharedOwnedOutput::new(
2562
- shared_funding_output, dual_funding_context .our_funding_satoshis,
2562
+ shared_funding_output, funding_negotiation_context .our_funding_satoshis,
2563
2563
))
2564
2564
);
2565
2565
} else {
@@ -2575,9 +2575,9 @@ pub(super) trait FundingTxConstructorV2<SP: Deref>: ChannelContextProvider<SP> w
2575
2575
.map_err(|_err| AbortReason::InternalError("Error getting destination script"))?
2576
2576
};
2577
2577
let change_value_opt = calculate_change_output_value(
2578
- pending_funding.is_outbound(), dual_funding_context .our_funding_satoshis,
2578
+ pending_funding.is_outbound(), funding_negotiation_context .our_funding_satoshis,
2579
2579
&funding_inputs, &funding_outputs,
2580
- dual_funding_context .funding_feerate_sat_per_1000_weight,
2580
+ funding_negotiation_context .funding_feerate_sat_per_1000_weight,
2581
2581
change_script.minimal_non_dust().to_sat(),
2582
2582
)?;
2583
2583
if let Some(change_value) = change_value_opt {
@@ -2586,7 +2586,7 @@ pub(super) trait FundingTxConstructorV2<SP: Deref>: ChannelContextProvider<SP> w
2586
2586
script_pubkey: change_script,
2587
2587
};
2588
2588
let change_output_weight = get_output_weight(&change_output.script_pubkey).to_wu();
2589
- let change_output_fee = fee_for_weight(dual_funding_context .funding_feerate_sat_per_1000_weight, change_output_weight);
2589
+ let change_output_fee = fee_for_weight(funding_negotiation_context .funding_feerate_sat_per_1000_weight, change_output_weight);
2590
2590
let change_value_decreased_with_fee = change_value.saturating_sub(change_output_fee);
2591
2591
// Check dust limit again
2592
2592
if change_value_decreased_with_fee > self.context().holder_dust_limit_satoshis {
@@ -2600,9 +2600,9 @@ pub(super) trait FundingTxConstructorV2<SP: Deref>: ChannelContextProvider<SP> w
2600
2600
holder_node_id,
2601
2601
counterparty_node_id: self.context().counterparty_node_id,
2602
2602
channel_id: self.context().channel_id(),
2603
- feerate_sat_per_kw: dual_funding_context .funding_feerate_sat_per_1000_weight,
2603
+ feerate_sat_per_kw: funding_negotiation_context .funding_feerate_sat_per_1000_weight,
2604
2604
is_initiator: pending_funding.is_outbound(),
2605
- funding_tx_locktime: dual_funding_context .funding_tx_locktime,
2605
+ funding_tx_locktime: funding_negotiation_context .funding_tx_locktime,
2606
2606
inputs_to_contribute: funding_inputs,
2607
2607
outputs_to_contribute: funding_outputs,
2608
2608
expected_remote_shared_funding_output,
@@ -2692,7 +2692,7 @@ pub(super) trait FundingTxConstructorV2<SP: Deref>: ChannelContextProvider<SP> w
2692
2692
where
2693
2693
L::Target: Logger
2694
2694
{
2695
- let our_funding_satoshis = self.dual_funding_context ()
2695
+ let our_funding_satoshis = self.funding_negotiation_context ()
2696
2696
.our_funding_satoshis;
2697
2697
let transaction_number = self.transaction_number();
2698
2698
let pending_funding = self.pending_funding();
@@ -2816,13 +2816,13 @@ impl<SP: Deref> FundingTxConstructorV2<SP> for PendingV2Channel<SP> where SP::Ta
2816
2816
}
2817
2817
2818
2818
#[inline]
2819
- fn dual_funding_context (&self) -> &DualFundingChannelContext {
2820
- &self.dual_funding_context
2819
+ fn funding_negotiation_context (&self) -> &FundingNegotiationContext {
2820
+ &self.funding_negotiation_context
2821
2821
}
2822
2822
2823
2823
#[inline]
2824
- fn dual_funding_context_mut (&mut self) -> &mut DualFundingChannelContext {
2825
- &mut self.dual_funding_context
2824
+ fn funding_negotiation_context_mut (&mut self) -> &mut FundingNegotiationContext {
2825
+ &mut self.funding_negotiation_context
2826
2826
}
2827
2827
2828
2828
fn transaction_number(&self) -> u64 {
@@ -2851,7 +2851,7 @@ impl<SP: Deref> FundingTxConstructorV2<SP> for PendingV2Channel<SP> where SP::Ta
2851
2851
struct RefundingScope {
2852
2852
// Fields belonging for [`PendingV2Channel`], except the context
2853
2853
pending_funding: FundingScope,
2854
- pending_dual_funding_context: DualFundingChannelContext ,
2854
+ pending_funding_negotiation_context: FundingNegotiationContext ,
2855
2855
/// The current interactive transaction construction session under negotiation.
2856
2856
pending_interactive_tx_constructor: Option<InteractiveTxConstructor>,
2857
2857
pending_interactive_tx_signing_session: Option<InteractiveTxSigningSession>,
@@ -5293,7 +5293,7 @@ fn check_v2_funding_inputs_sufficient(
5293
5293
}
5294
5294
5295
5295
/// Context for dual-funded channels.
5296
- pub(super) struct DualFundingChannelContext {
5296
+ pub(super) struct FundingNegotiationContext {
5297
5297
/// The amount in satoshis we will be contributing to the channel.
5298
5298
pub our_funding_satoshis: u64,
5299
5299
/// The amount in satoshis our counterparty will be contributing to the channel.
@@ -9124,7 +9124,7 @@ impl<SP: Deref> FundedChannel<SP> where
9124
9124
next_remote_commitment_tx_fee_info_cached: Mutex::new(None),
9125
9125
};
9126
9126
9127
- let pending_dual_funding_context = DualFundingChannelContext {
9127
+ let pending_funding_negotiation_context = FundingNegotiationContext {
9128
9128
our_funding_satoshis,
9129
9129
their_funding_satoshis: Some(their_funding_satoshis),
9130
9130
funding_tx_locktime: LockTime::from_consensus(msg.locktime),
@@ -9134,15 +9134,15 @@ impl<SP: Deref> FundedChannel<SP> where
9134
9134
9135
9135
let refunding_scope = Some(RefundingScope {
9136
9136
pending_funding,
9137
- pending_dual_funding_context ,
9137
+ pending_funding_negotiation_context ,
9138
9138
pending_interactive_tx_constructor: None,
9139
9139
pending_interactive_tx_signing_session: None,
9140
9140
});
9141
9141
self.pending_splice = Some(PendingSplice {
9142
9142
our_funding_contribution,
9143
9143
funding_feerate_per_kw: msg.funding_feerate_per_kw,
9144
9144
locktime: msg.locktime,
9145
- our_funding_inputs: Vec::new(), // inputs go directly to [`DualFundingChannelContext `] above
9145
+ our_funding_inputs: Vec::new(), // inputs go directly to [`FundingNegotiationContext `] above
9146
9146
awaiting_splice_ack: false, // we don't need any additional message for the handshake
9147
9147
refunding_scope,
9148
9148
});
@@ -9244,20 +9244,20 @@ impl<SP: Deref> FundedChannel<SP> where
9244
9244
next_remote_commitment_tx_fee_info_cached: Mutex::new(None),
9245
9245
};
9246
9246
9247
- let mut pending_dual_funding_context = DualFundingChannelContext {
9247
+ let mut pending_funding_negotiation_context = FundingNegotiationContext {
9248
9248
our_funding_satoshis,
9249
9249
their_funding_satoshis: Some(their_funding_satoshis),
9250
9250
funding_tx_locktime: LockTime::from_consensus(pending_splice.locktime),
9251
9251
funding_feerate_sat_per_1000_weight: pending_splice.funding_feerate_per_kw,
9252
9252
our_funding_inputs: Vec::new(), // set below
9253
9253
};
9254
9254
if let Some(ref mut pending_splice_mut) = &mut self.pending_splice {
9255
- pending_dual_funding_context .our_funding_inputs = std::mem::take(&mut pending_splice_mut.our_funding_inputs);
9255
+ pending_funding_negotiation_context .our_funding_inputs = std::mem::take(&mut pending_splice_mut.our_funding_inputs);
9256
9256
};
9257
9257
9258
9258
let refunding_scope = RefundingScope {
9259
9259
pending_funding,
9260
- pending_dual_funding_context ,
9260
+ pending_funding_negotiation_context ,
9261
9261
pending_interactive_tx_constructor: None,
9262
9262
pending_interactive_tx_signing_session: None,
9263
9263
};
@@ -10659,7 +10659,7 @@ pub(super) struct PendingV2Channel<SP: Deref> where SP::Target: SignerProvider {
10659
10659
pub funding: FundingScope,
10660
10660
pub context: ChannelContext<SP>,
10661
10661
pub unfunded_context: UnfundedChannelContext,
10662
- pub dual_funding_context: DualFundingChannelContext ,
10662
+ pub funding_negotiation_context: FundingNegotiationContext ,
10663
10663
/// The current interactive transaction construction session under negotiation.
10664
10664
pub interactive_tx_constructor: Option<InteractiveTxConstructor>,
10665
10665
/// The signing session created after `tx_complete` handling
@@ -10718,7 +10718,7 @@ impl<SP: Deref> PendingV2Channel<SP> where SP::Target: SignerProvider {
10718
10718
unfunded_channel_age_ticks: 0,
10719
10719
holder_commitment_point: HolderCommitmentPoint::new(&context.holder_signer, &context.secp_ctx),
10720
10720
};
10721
- let dual_funding_context = DualFundingChannelContext {
10721
+ let funding_negotiation_context = FundingNegotiationContext {
10722
10722
our_funding_satoshis: funding_satoshis,
10723
10723
// TODO(dual_funding) TODO(splicing) Include counterparty contribution, once that's enabled
10724
10724
their_funding_satoshis: None,
@@ -10730,7 +10730,7 @@ impl<SP: Deref> PendingV2Channel<SP> where SP::Target: SignerProvider {
10730
10730
funding,
10731
10731
context,
10732
10732
unfunded_context,
10733
- dual_funding_context ,
10733
+ funding_negotiation_context ,
10734
10734
interactive_tx_constructor: None,
10735
10735
interactive_tx_signing_session: None,
10736
10736
};
@@ -10799,7 +10799,7 @@ impl<SP: Deref> PendingV2Channel<SP> where SP::Target: SignerProvider {
10799
10799
},
10800
10800
funding_feerate_sat_per_1000_weight: self.context.feerate_per_kw,
10801
10801
second_per_commitment_point,
10802
- locktime: self.dual_funding_context .funding_tx_locktime.to_consensus_u32(),
10802
+ locktime: self.funding_negotiation_context .funding_tx_locktime.to_consensus_u32(),
10803
10803
require_confirmed_inputs: None,
10804
10804
}
10805
10805
}
@@ -10870,7 +10870,7 @@ impl<SP: Deref> PendingV2Channel<SP> where SP::Target: SignerProvider {
10870
10870
&funding.get_counterparty_pubkeys().revocation_basepoint);
10871
10871
context.channel_id = channel_id;
10872
10872
10873
- let dual_funding_context = DualFundingChannelContext {
10873
+ let funding_negotiation_context = FundingNegotiationContext {
10874
10874
our_funding_satoshis: our_funding_satoshis,
10875
10875
their_funding_satoshis: Some(msg.common_fields.funding_satoshis),
10876
10876
funding_tx_locktime: LockTime::from_consensus(msg.locktime),
@@ -10884,8 +10884,8 @@ impl<SP: Deref> PendingV2Channel<SP> where SP::Target: SignerProvider {
10884
10884
holder_node_id,
10885
10885
counterparty_node_id,
10886
10886
channel_id: context.channel_id,
10887
- feerate_sat_per_kw: dual_funding_context .funding_feerate_sat_per_1000_weight,
10888
- funding_tx_locktime: dual_funding_context .funding_tx_locktime,
10887
+ feerate_sat_per_kw: funding_negotiation_context .funding_feerate_sat_per_1000_weight,
10888
+ funding_tx_locktime: funding_negotiation_context .funding_tx_locktime,
10889
10889
is_initiator: false,
10890
10890
inputs_to_contribute: our_funding_inputs,
10891
10891
outputs_to_contribute: Vec::new(),
@@ -10903,7 +10903,7 @@ impl<SP: Deref> PendingV2Channel<SP> where SP::Target: SignerProvider {
10903
10903
Ok(Self {
10904
10904
funding,
10905
10905
context,
10906
- dual_funding_context ,
10906
+ funding_negotiation_context ,
10907
10907
interactive_tx_constructor,
10908
10908
interactive_tx_signing_session: None,
10909
10909
unfunded_context,
@@ -10968,7 +10968,7 @@ impl<SP: Deref> PendingV2Channel<SP> where SP::Target: SignerProvider {
10968
10968
}),
10969
10969
channel_type: Some(self.funding.get_channel_type().clone()),
10970
10970
},
10971
- funding_satoshis: self.dual_funding_context .our_funding_satoshis,
10971
+ funding_satoshis: self.funding_negotiation_context .our_funding_satoshis,
10972
10972
second_per_commitment_point,
10973
10973
require_confirmed_inputs: None,
10974
10974
}
0 commit comments