@@ -5979,7 +5979,7 @@ pub(super) struct FundingNegotiationContext {
59795979 pub shared_funding_input: Option<SharedOwnedInput>,
59805980 /// The funding inputs we will be contributing to the channel.
59815981 #[allow(dead_code)] // TODO(dual_funding): Remove once contribution to V2 channels is enabled.
5982- pub our_funding_inputs: Vec<(TxIn, Transaction)>,
5982+ pub our_funding_inputs: Vec<(TxIn, Transaction, Weight )>,
59835983 /// The change output script. This will be used if needed or -- if not set -- generated using
59845984 /// `SignerProvider::get_destination_script`.
59855985 #[allow(dead_code)] // TODO(splicing): Remove once splicing is enabled.
@@ -6051,6 +6051,9 @@ impl FundingNegotiationContext {
60516051 }
60526052 }
60536053
6054+ let funding_inputs =
6055+ self.our_funding_inputs.into_iter().map(|(txin, tx, _)| (txin, tx)).collect();
6056+
60546057 let constructor_args = InteractiveTxConstructorArgs {
60556058 entropy_source,
60566059 holder_node_id,
@@ -6059,7 +6062,7 @@ impl FundingNegotiationContext {
60596062 feerate_sat_per_kw: self.funding_feerate_sat_per_1000_weight,
60606063 is_initiator: self.is_initiator,
60616064 funding_tx_locktime: self.funding_tx_locktime,
6062- inputs_to_contribute: self.our_funding_inputs ,
6065+ inputs_to_contribute: funding_inputs ,
60636066 shared_funding_input: self.shared_funding_input,
60646067 shared_funding_output: SharedOwnedOutput::new(
60656068 shared_funding_output,
@@ -10669,9 +10672,8 @@ where
1066910672 err,
1067010673 ),
1067110674 })?;
10672- // Convert inputs
10673- let mut funding_inputs = Vec::new();
10674- for (txin, tx, _) in our_funding_inputs.into_iter() {
10675+
10676+ for (txin, tx, _) in our_funding_inputs.iter() {
1067510677 const MESSAGE_TEMPLATE: msgs::TxAddInput = msgs::TxAddInput {
1067610678 channel_id: ChannelId([0; 32]),
1067710679 serial_id: 0,
@@ -10689,8 +10691,6 @@ where
1068910691 ),
1069010692 });
1069110693 }
10692-
10693- funding_inputs.push((txin, tx));
1069410694 }
1069510695
1069610696 let prev_funding_input = self.funding.to_splice_funding_input();
@@ -10700,7 +10700,7 @@ where
1070010700 funding_tx_locktime: LockTime::from_consensus(locktime),
1070110701 funding_feerate_sat_per_1000_weight: funding_feerate_per_kw,
1070210702 shared_funding_input: Some(prev_funding_input),
10703- our_funding_inputs: funding_inputs ,
10703+ our_funding_inputs,
1070410704 change_script,
1070510705 };
1070610706
@@ -12469,7 +12469,7 @@ where
1246912469 pub fn new_outbound<ES: Deref, F: Deref, L: Deref>(
1247012470 fee_estimator: &LowerBoundedFeeEstimator<F>, entropy_source: &ES, signer_provider: &SP,
1247112471 counterparty_node_id: PublicKey, their_features: &InitFeatures, funding_satoshis: u64,
12472- funding_inputs: Vec<(TxIn, Transaction)>, user_id: u128, config: &UserConfig,
12472+ funding_inputs: Vec<(TxIn, Transaction, Weight )>, user_id: u128, config: &UserConfig,
1247312473 current_chain_height: u32, outbound_scid_alias: u64, funding_confirmation_target: ConfirmationTarget,
1247412474 logger: L,
1247512475 ) -> Result<Self, APIError>
@@ -12683,6 +12683,8 @@ where
1268312683 value: Amount::from_sat(funding.get_value_satoshis()),
1268412684 script_pubkey: funding.get_funding_redeemscript().to_p2wsh(),
1268512685 };
12686+ let inputs_to_contribute =
12687+ our_funding_inputs.into_iter().map(|(txin, tx, _)| (txin, tx)).collect();
1268612688
1268712689 let interactive_tx_constructor = Some(InteractiveTxConstructor::new(
1268812690 InteractiveTxConstructorArgs {
@@ -12693,7 +12695,7 @@ where
1269312695 feerate_sat_per_kw: funding_negotiation_context.funding_feerate_sat_per_1000_weight,
1269412696 funding_tx_locktime: funding_negotiation_context.funding_tx_locktime,
1269512697 is_initiator: false,
12696- inputs_to_contribute: our_funding_inputs ,
12698+ inputs_to_contribute,
1269712699 shared_funding_input: None,
1269812700 shared_funding_output: SharedOwnedOutput::new(shared_funding_output, our_funding_contribution_sats),
1269912701 outputs_to_contribute: Vec::new(),
0 commit comments