@@ -5977,7 +5977,7 @@ pub(super) struct FundingNegotiationContext {
5977
5977
pub shared_funding_input: Option<SharedOwnedInput>,
5978
5978
/// The funding inputs we will be contributing to the channel.
5979
5979
#[allow(dead_code)] // TODO(dual_funding): Remove once contribution to V2 channels is enabled.
5980
- pub our_funding_inputs: Vec<(TxIn, Transaction)>,
5980
+ pub our_funding_inputs: Vec<(TxIn, Transaction, Weight )>,
5981
5981
/// The change output script. This will be used if needed or -- if not set -- generated using
5982
5982
/// `SignerProvider::get_destination_script`.
5983
5983
#[allow(dead_code)] // TODO(splicing): Remove once splicing is enabled.
@@ -6049,6 +6049,9 @@ impl FundingNegotiationContext {
6049
6049
}
6050
6050
}
6051
6051
6052
+ let funding_inputs =
6053
+ self.our_funding_inputs.into_iter().map(|(txin, tx, _)| (txin, tx)).collect();
6054
+
6052
6055
let constructor_args = InteractiveTxConstructorArgs {
6053
6056
entropy_source,
6054
6057
holder_node_id,
@@ -6057,7 +6060,7 @@ impl FundingNegotiationContext {
6057
6060
feerate_sat_per_kw: self.funding_feerate_sat_per_1000_weight,
6058
6061
is_initiator: self.is_initiator,
6059
6062
funding_tx_locktime: self.funding_tx_locktime,
6060
- inputs_to_contribute: self.our_funding_inputs ,
6063
+ inputs_to_contribute: funding_inputs ,
6061
6064
shared_funding_input: self.shared_funding_input,
6062
6065
shared_funding_output: SharedOwnedOutput::new(
6063
6066
shared_funding_output,
@@ -10674,9 +10677,8 @@ where
10674
10677
err,
10675
10678
),
10676
10679
})?;
10677
- // Convert inputs
10678
- let mut funding_inputs = Vec::new();
10679
- for (txin, tx, _) in our_funding_inputs.into_iter() {
10680
+
10681
+ for (_, tx, _) in our_funding_inputs.iter() {
10680
10682
const MESSAGE_TEMPLATE: msgs::TxAddInput = msgs::TxAddInput {
10681
10683
channel_id: ChannelId([0; 32]),
10682
10684
serial_id: 0,
@@ -10694,8 +10696,6 @@ where
10694
10696
),
10695
10697
});
10696
10698
}
10697
-
10698
- funding_inputs.push((txin, tx));
10699
10699
}
10700
10700
10701
10701
let prev_funding_input = self.funding.to_splice_funding_input();
@@ -10705,7 +10705,7 @@ where
10705
10705
funding_tx_locktime: LockTime::from_consensus(locktime),
10706
10706
funding_feerate_sat_per_1000_weight: funding_feerate_per_kw,
10707
10707
shared_funding_input: Some(prev_funding_input),
10708
- our_funding_inputs: funding_inputs ,
10708
+ our_funding_inputs,
10709
10709
change_script,
10710
10710
};
10711
10711
@@ -12472,7 +12472,7 @@ where
12472
12472
pub fn new_outbound<ES: Deref, F: Deref, L: Deref>(
12473
12473
fee_estimator: &LowerBoundedFeeEstimator<F>, entropy_source: &ES, signer_provider: &SP,
12474
12474
counterparty_node_id: PublicKey, their_features: &InitFeatures, funding_satoshis: u64,
12475
- funding_inputs: Vec<(TxIn, Transaction)>, user_id: u128, config: &UserConfig,
12475
+ funding_inputs: Vec<(TxIn, Transaction, Weight )>, user_id: u128, config: &UserConfig,
12476
12476
current_chain_height: u32, outbound_scid_alias: u64, funding_confirmation_target: ConfirmationTarget,
12477
12477
logger: L,
12478
12478
) -> Result<Self, APIError>
@@ -12686,6 +12686,8 @@ where
12686
12686
value: Amount::from_sat(funding.get_value_satoshis()),
12687
12687
script_pubkey: funding.get_funding_redeemscript().to_p2wsh(),
12688
12688
};
12689
+ let inputs_to_contribute =
12690
+ our_funding_inputs.into_iter().map(|(txin, tx, _)| (txin, tx)).collect();
12689
12691
12690
12692
let interactive_tx_constructor = Some(InteractiveTxConstructor::new(
12691
12693
InteractiveTxConstructorArgs {
@@ -12696,7 +12698,7 @@ where
12696
12698
feerate_sat_per_kw: funding_negotiation_context.funding_feerate_sat_per_1000_weight,
12697
12699
funding_tx_locktime: funding_negotiation_context.funding_tx_locktime,
12698
12700
is_initiator: false,
12699
- inputs_to_contribute: our_funding_inputs ,
12701
+ inputs_to_contribute,
12700
12702
shared_funding_input: None,
12701
12703
shared_funding_output: SharedOwnedOutput::new(shared_funding_output, our_funding_contribution_sats),
12702
12704
outputs_to_contribute: Vec::new(),
0 commit comments