@@ -6025,7 +6025,9 @@ impl FundingNegotiationContext {
6025
6025
};
6026
6026
6027
6027
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
+ },
6029
6031
};
6030
6032
6031
6033
// Add change output if necessary
@@ -6079,7 +6081,7 @@ pub enum FundingTxContributions {
6079
6081
InputsOnly {
6080
6082
/// The inputs used to meet the contributed amount. Any excess amount will be sent to a
6081
6083
/// change output.
6082
- inputs: Vec<(TxIn, Transaction)>,
6084
+ inputs: Vec<(TxIn, Transaction, Weight )>,
6083
6085
6084
6086
/// An optional change output script. This will be used if needed or, if not set, generated
6085
6087
/// using `SignerProvider::get_destination_script`.
@@ -6089,7 +6091,7 @@ pub enum FundingTxContributions {
6089
6091
6090
6092
impl FundingTxContributions {
6091
6093
/// 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 )] {
6093
6095
match self {
6094
6096
FundingTxContributions::InputsOnly { inputs, .. } => &inputs[..],
6095
6097
}
@@ -10701,9 +10703,8 @@ where
10701
10703
err,
10702
10704
),
10703
10705
})?;
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() {
10707
10708
const MESSAGE_TEMPLATE: msgs::TxAddInput = msgs::TxAddInput {
10708
10709
channel_id: ChannelId([0; 32]),
10709
10710
serial_id: 0,
@@ -10718,12 +10719,10 @@ where
10718
10719
err: format!("Funding input's prevtx is too large for tx_add_input"),
10719
10720
});
10720
10721
}
10721
-
10722
- funding_inputs.push((txin, tx));
10723
10722
}
10724
10723
10725
10724
let funding_tx_contributions =
10726
- FundingTxContributions::InputsOnly { inputs: funding_inputs , change_script };
10725
+ FundingTxContributions::InputsOnly { inputs: our_funding_inputs , change_script };
10727
10726
10728
10727
let prev_funding_input = self.funding.to_splice_funding_input();
10729
10728
let funding_negotiation_context = FundingNegotiationContext {
@@ -12500,7 +12499,7 @@ where
12500
12499
pub fn new_outbound<ES: Deref, F: Deref, L: Deref>(
12501
12500
fee_estimator: &LowerBoundedFeeEstimator<F>, entropy_source: &ES, signer_provider: &SP,
12502
12501
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,
12504
12503
current_chain_height: u32, outbound_scid_alias: u64, funding_confirmation_target: ConfirmationTarget,
12505
12504
logger: L,
12506
12505
) -> Result<Self, APIError>
@@ -12661,7 +12660,7 @@ where
12661
12660
{
12662
12661
// TODO(dual_funding): Take these as input once supported
12663
12662
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();
12665
12664
12666
12665
let channel_value_satoshis =
12667
12666
our_funding_contribution_sats.saturating_add(msg.common_fields.funding_satoshis);
@@ -12730,7 +12729,7 @@ where
12730
12729
feerate_sat_per_kw: funding_negotiation_context.funding_feerate_sat_per_1000_weight,
12731
12730
funding_tx_locktime: funding_negotiation_context.funding_tx_locktime,
12732
12731
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() ,
12734
12733
shared_funding_input: None,
12735
12734
shared_funding_output: SharedOwnedOutput::new(shared_funding_output, our_funding_contribution_sats),
12736
12735
outputs_to_contribute: Vec::new(),
0 commit comments