@@ -6025,7 +6025,9 @@ impl FundingNegotiationContext {
60256025 };
60266026
60276027 let (inputs_to_contribute, change_script) = match self.funding_tx_contributions {
6028- FundingTxContributions::InputsOnly { inputs, change_script } => (inputs, change_script),
6028+ FundingTxContributions::InputsOnly { inputs, change_script } => {
6029+ (inputs.into_iter().map(|(txin, tx, _)| (txin, tx)).collect(), change_script)
6030+ },
60296031 };
60306032
60316033 // Add change output if necessary
@@ -6079,7 +6081,7 @@ pub enum FundingTxContributions {
60796081 InputsOnly {
60806082 /// The inputs used to meet the contributed amount. Any excess amount will be sent to a
60816083 /// change output.
6082- inputs: Vec<(TxIn, Transaction)>,
6084+ inputs: Vec<(TxIn, Transaction, Weight )>,
60836085
60846086 /// An optional change output script. This will be used if needed or, if not set, generated
60856087 /// using `SignerProvider::get_destination_script`.
@@ -6089,7 +6091,7 @@ pub enum FundingTxContributions {
60896091
60906092impl FundingTxContributions {
60916093 /// Returns an inputs to be contributed to the funding transaction.
6092- pub fn inputs(&self) -> &[(TxIn, Transaction)] {
6094+ pub fn inputs(&self) -> &[(TxIn, Transaction, Weight )] {
60936095 match self {
60946096 FundingTxContributions::InputsOnly { inputs, .. } => &inputs[..],
60956097 }
@@ -10701,9 +10703,8 @@ where
1070110703 err,
1070210704 ),
1070310705 })?;
10704- // Convert inputs
10705- let mut funding_inputs = Vec::new();
10706- for (txin, tx, _) in our_funding_inputs.into_iter() {
10706+
10707+ for (_, tx, _) in our_funding_inputs.iter() {
1070710708 const MESSAGE_TEMPLATE: msgs::TxAddInput = msgs::TxAddInput {
1070810709 channel_id: ChannelId([0; 32]),
1070910710 serial_id: 0,
@@ -10718,12 +10719,10 @@ where
1071810719 err: format!("Funding input's prevtx is too large for tx_add_input"),
1071910720 });
1072010721 }
10721-
10722- funding_inputs.push((txin, tx));
1072310722 }
1072410723
1072510724 let funding_tx_contributions =
10726- FundingTxContributions::InputsOnly { inputs: funding_inputs , change_script };
10725+ FundingTxContributions::InputsOnly { inputs: our_funding_inputs , change_script };
1072710726
1072810727 let prev_funding_input = self.funding.to_splice_funding_input();
1072910728 let funding_negotiation_context = FundingNegotiationContext {
@@ -12500,7 +12499,7 @@ where
1250012499 pub fn new_outbound<ES: Deref, F: Deref, L: Deref>(
1250112500 fee_estimator: &LowerBoundedFeeEstimator<F>, entropy_source: &ES, signer_provider: &SP,
1250212501 counterparty_node_id: PublicKey, their_features: &InitFeatures, funding_satoshis: u64,
12503- funding_inputs: Vec<(TxIn, Transaction)>, user_id: u128, config: &UserConfig,
12502+ funding_inputs: Vec<(TxIn, Transaction, Weight )>, user_id: u128, config: &UserConfig,
1250412503 current_chain_height: u32, outbound_scid_alias: u64, funding_confirmation_target: ConfirmationTarget,
1250512504 logger: L,
1250612505 ) -> Result<Self, APIError>
@@ -12661,7 +12660,7 @@ where
1266112660 {
1266212661 // TODO(dual_funding): Take these as input once supported
1266312662 let (our_funding_contribution, our_funding_contribution_sats) = (SignedAmount::ZERO, 0u64);
12664- let our_funding_inputs = Vec::new();
12663+ let our_funding_inputs: Vec<(TxIn, Transaction, Weight)> = Vec::new();
1266512664
1266612665 let channel_value_satoshis =
1266712666 our_funding_contribution_sats.saturating_add(msg.common_fields.funding_satoshis);
@@ -12730,7 +12729,7 @@ where
1273012729 feerate_sat_per_kw: funding_negotiation_context.funding_feerate_sat_per_1000_weight,
1273112730 funding_tx_locktime: funding_negotiation_context.funding_tx_locktime,
1273212731 is_initiator: false,
12733- inputs_to_contribute: our_funding_inputs,
12732+ inputs_to_contribute: our_funding_inputs.into_iter().map(|(txin, tx, _)| (txin, tx)).collect() ,
1273412733 shared_funding_input: None,
1273512734 shared_funding_output: SharedOwnedOutput::new(shared_funding_output, our_funding_contribution_sats),
1273612735 outputs_to_contribute: Vec::new(),
0 commit comments