@@ -5978,7 +5978,7 @@ pub(super) struct FundingNegotiationContext {
59785978 pub shared_funding_input: Option<SharedOwnedInput>,
59795979 /// The funding inputs we will be contributing to the channel.
59805980 #[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 )>,
59825982 /// The change output script. This will be used if needed or -- if not set -- generated using
59835983 /// `SignerProvider::get_destination_script`.
59845984 #[allow(dead_code)] // TODO(splicing): Remove once splicing is enabled.
@@ -6050,6 +6050,9 @@ impl FundingNegotiationContext {
60506050 }
60516051 }
60526052
6053+ let funding_inputs =
6054+ self.our_funding_inputs.into_iter().map(|(txin, tx, _)| (txin, tx)).collect();
6055+
60536056 let constructor_args = InteractiveTxConstructorArgs {
60546057 entropy_source,
60556058 holder_node_id,
@@ -6058,7 +6061,7 @@ impl FundingNegotiationContext {
60586061 feerate_sat_per_kw: self.funding_feerate_sat_per_1000_weight,
60596062 is_initiator: self.is_initiator,
60606063 funding_tx_locktime: self.funding_tx_locktime,
6061- inputs_to_contribute: self.our_funding_inputs ,
6064+ inputs_to_contribute: funding_inputs ,
60626065 shared_funding_input: self.shared_funding_input,
60636066 shared_funding_output: SharedOwnedOutput::new(
60646067 shared_funding_output,
@@ -10668,9 +10671,8 @@ where
1066810671 err,
1066910672 ),
1067010673 })?;
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() {
1067410676 const MESSAGE_TEMPLATE: msgs::TxAddInput = msgs::TxAddInput {
1067510677 channel_id: ChannelId([0; 32]),
1067610678 serial_id: 0,
@@ -10688,8 +10690,6 @@ where
1068810690 ),
1068910691 });
1069010692 }
10691-
10692- funding_inputs.push((txin, tx));
1069310693 }
1069410694
1069510695 let prev_funding_input = self.funding.to_splice_funding_input();
@@ -10699,7 +10699,7 @@ where
1069910699 funding_tx_locktime: LockTime::from_consensus(locktime),
1070010700 funding_feerate_sat_per_1000_weight: funding_feerate_per_kw,
1070110701 shared_funding_input: Some(prev_funding_input),
10702- our_funding_inputs: funding_inputs ,
10702+ our_funding_inputs,
1070310703 change_script,
1070410704 };
1070510705
@@ -12468,7 +12468,7 @@ where
1246812468 pub fn new_outbound<ES: Deref, F: Deref, L: Deref>(
1246912469 fee_estimator: &LowerBoundedFeeEstimator<F>, entropy_source: &ES, signer_provider: &SP,
1247012470 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,
1247212472 current_chain_height: u32, outbound_scid_alias: u64, funding_confirmation_target: ConfirmationTarget,
1247312473 logger: L,
1247412474 ) -> Result<Self, APIError>
@@ -12682,6 +12682,8 @@ where
1268212682 value: Amount::from_sat(funding.get_value_satoshis()),
1268312683 script_pubkey: funding.get_funding_redeemscript().to_p2wsh(),
1268412684 };
12685+ let inputs_to_contribute =
12686+ our_funding_inputs.into_iter().map(|(txin, tx, _)| (txin, tx)).collect();
1268512687
1268612688 let interactive_tx_constructor = Some(InteractiveTxConstructor::new(
1268712689 InteractiveTxConstructorArgs {
@@ -12692,7 +12694,7 @@ where
1269212694 feerate_sat_per_kw: funding_negotiation_context.funding_feerate_sat_per_1000_weight,
1269312695 funding_tx_locktime: funding_negotiation_context.funding_tx_locktime,
1269412696 is_initiator: false,
12695- inputs_to_contribute: our_funding_inputs ,
12697+ inputs_to_contribute,
1269612698 shared_funding_input: None,
1269712699 shared_funding_output: SharedOwnedOutput::new(shared_funding_output, our_funding_contribution_sats),
1269812700 outputs_to_contribute: Vec::new(),
0 commit comments