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