@@ -5978,7 +5978,7 @@ pub(super) struct FundingNegotiationContext {
5978
5978
pub shared_funding_input: Option<SharedOwnedInput>,
5979
5979
/// The funding inputs we will be contributing to the channel.
5980
5980
#[allow(dead_code)] // TODO(dual_funding): Remove once contribution to V2 channels is enabled.
5981
- pub our_funding_inputs: Vec<(TxIn, Transaction)>,
5981
+ pub our_funding_inputs: Vec<(TxIn, Transaction, Weight )>,
5982
5982
/// The change output script. This will be used if needed or -- if not set -- generated using
5983
5983
/// `SignerProvider::get_destination_script`.
5984
5984
#[allow(dead_code)] // TODO(splicing): Remove once splicing is enabled.
@@ -6050,6 +6050,9 @@ impl FundingNegotiationContext {
6050
6050
}
6051
6051
}
6052
6052
6053
+ let funding_inputs =
6054
+ self.our_funding_inputs.into_iter().map(|(txin, tx, _)| (txin, tx)).collect();
6055
+
6053
6056
let constructor_args = InteractiveTxConstructorArgs {
6054
6057
entropy_source,
6055
6058
holder_node_id,
@@ -6058,7 +6061,7 @@ impl FundingNegotiationContext {
6058
6061
feerate_sat_per_kw: self.funding_feerate_sat_per_1000_weight,
6059
6062
is_initiator: self.is_initiator,
6060
6063
funding_tx_locktime: self.funding_tx_locktime,
6061
- inputs_to_contribute: self.our_funding_inputs ,
6064
+ inputs_to_contribute: funding_inputs ,
6062
6065
shared_funding_input: self.shared_funding_input,
6063
6066
shared_funding_output: SharedOwnedOutput::new(
6064
6067
shared_funding_output,
@@ -10668,9 +10671,8 @@ where
10668
10671
err,
10669
10672
),
10670
10673
})?;
10671
- // Convert inputs
10672
- let mut funding_inputs = Vec::new();
10673
- for (txin, tx, _) in our_funding_inputs.into_iter() {
10674
+
10675
+ for (txin, tx, _) in our_funding_inputs.iter() {
10674
10676
const MESSAGE_TEMPLATE: msgs::TxAddInput = msgs::TxAddInput {
10675
10677
channel_id: ChannelId([0; 32]),
10676
10678
serial_id: 0,
@@ -10688,8 +10690,6 @@ where
10688
10690
),
10689
10691
});
10690
10692
}
10691
-
10692
- funding_inputs.push((txin, tx));
10693
10693
}
10694
10694
10695
10695
let prev_funding_input = self.funding.to_splice_funding_input();
@@ -10699,7 +10699,7 @@ where
10699
10699
funding_tx_locktime: LockTime::from_consensus(locktime),
10700
10700
funding_feerate_sat_per_1000_weight: funding_feerate_per_kw,
10701
10701
shared_funding_input: Some(prev_funding_input),
10702
- our_funding_inputs: funding_inputs ,
10702
+ our_funding_inputs,
10703
10703
change_script,
10704
10704
};
10705
10705
@@ -12468,7 +12468,7 @@ where
12468
12468
pub fn new_outbound<ES: Deref, F: Deref, L: Deref>(
12469
12469
fee_estimator: &LowerBoundedFeeEstimator<F>, entropy_source: &ES, signer_provider: &SP,
12470
12470
counterparty_node_id: PublicKey, their_features: &InitFeatures, funding_satoshis: u64,
12471
- funding_inputs: Vec<(TxIn, Transaction)>, user_id: u128, config: &UserConfig,
12471
+ funding_inputs: Vec<(TxIn, Transaction, Weight )>, user_id: u128, config: &UserConfig,
12472
12472
current_chain_height: u32, outbound_scid_alias: u64, funding_confirmation_target: ConfirmationTarget,
12473
12473
logger: L,
12474
12474
) -> Result<Self, APIError>
@@ -12682,6 +12682,8 @@ where
12682
12682
value: Amount::from_sat(funding.get_value_satoshis()),
12683
12683
script_pubkey: funding.get_funding_redeemscript().to_p2wsh(),
12684
12684
};
12685
+ let inputs_to_contribute =
12686
+ our_funding_inputs.into_iter().map(|(txin, tx, _)| (txin, tx)).collect();
12685
12687
12686
12688
let interactive_tx_constructor = Some(InteractiveTxConstructor::new(
12687
12689
InteractiveTxConstructorArgs {
@@ -12692,7 +12694,7 @@ where
12692
12694
feerate_sat_per_kw: funding_negotiation_context.funding_feerate_sat_per_1000_weight,
12693
12695
funding_tx_locktime: funding_negotiation_context.funding_tx_locktime,
12694
12696
is_initiator: false,
12695
- inputs_to_contribute: our_funding_inputs ,
12697
+ inputs_to_contribute,
12696
12698
shared_funding_input: None,
12697
12699
shared_funding_output: SharedOwnedOutput::new(shared_funding_output, our_funding_contribution_sats),
12698
12700
outputs_to_contribute: Vec::new(),
0 commit comments