Skip to content

Commit c2e4db1

Browse files
committed
Rename extra_input to prev_funding_input
1 parent b7f0bf4 commit c2e4db1

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

Diff for: lightning/src/ln/channel.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -1702,29 +1702,29 @@ pub(super) trait InteractivelyFunded<SP: Deref> where SP::Target: SignerProvider
17021702
#[allow(dead_code)] // TODO(dual_funding): Remove once contribution to V2 channels is enabled
17031703
fn begin_interactive_funding_tx_construction<ES: Deref>(
17041704
&mut self, signer_provider: &SP, entropy_source: &ES, holder_node_id: PublicKey,
1705-
extra_input: Option<(TxIn, TransactionU16LenLimited)>,
1705+
prev_funding_input: Option<(TxIn, TransactionU16LenLimited)>,
17061706
) -> Result<Option<InteractiveTxMessageSend>, APIError>
17071707
where ES::Target: EntropySource
17081708
{
1709-
let mut funding_inputs_with_extra = self.dual_funding_context_mut().our_funding_inputs.take().unwrap_or_else(|| vec![]);
1709+
let mut funding_inputs = self.dual_funding_context_mut().our_funding_inputs.take().unwrap_or_else(|| vec![]);
17101710

1711-
if let Some(extra_input) = extra_input {
1712-
funding_inputs_with_extra.push(extra_input);
1711+
if let Some(prev_funding_input) = prev_funding_input {
1712+
funding_inputs.push(prev_funding_input);
17131713
}
17141714

1715-
let mut funding_inputs_prev_outputs: Vec<TxOut> = Vec::with_capacity(funding_inputs_with_extra.len());
1715+
let mut funding_inputs_prev_outputs: Vec<TxOut> = Vec::with_capacity(funding_inputs.len());
17161716
// Check that vouts exist for each TxIn in provided transactions.
1717-
for (idx, input) in funding_inputs_with_extra.iter().enumerate() {
1717+
for (idx, input) in funding_inputs.iter().enumerate() {
17181718
if let Some(output) = input.1.as_transaction().output.get(input.0.previous_output.vout as usize) {
17191719
funding_inputs_prev_outputs.push(output.clone());
17201720
} else {
17211721
return Err(APIError::APIMisuseError {
1722-
err: format!("Transaction with txid {} does not have an output with vout of {} corresponding to TxIn at funding_inputs_with_extra[{}]",
1722+
err: format!("Transaction with txid {} does not have an output with vout of {} corresponding to TxIn at funding_inputs[{}]",
17231723
input.1.as_transaction().compute_txid(), input.0.previous_output.vout, idx) });
17241724
}
17251725
}
17261726

1727-
let total_input_satoshis: u64 = funding_inputs_with_extra.iter().map(
1727+
let total_input_satoshis: u64 = funding_inputs.iter().map(
17281728
|input| input.1.as_transaction().output.get(input.0.previous_output.vout as usize).map(|out| out.value.to_sat()).unwrap_or(0)
17291729
).sum();
17301730
if total_input_satoshis < self.dual_funding_context().our_funding_satoshis {
@@ -1779,7 +1779,7 @@ pub(super) trait InteractivelyFunded<SP: Deref> where SP::Target: SignerProvider
17791779
feerate_sat_per_kw: self.dual_funding_context_mut().funding_feerate_sat_per_1000_weight,
17801780
is_initiator: self.is_initiator(),
17811781
funding_tx_locktime: self.dual_funding_context_mut().funding_tx_locktime,
1782-
inputs_to_contribute: funding_inputs_with_extra,
1782+
inputs_to_contribute: funding_inputs,
17831783
outputs_to_contribute: funding_outputs,
17841784
expected_remote_shared_funding_output,
17851785
};

0 commit comments

Comments
 (0)