Skip to content

Commit fa482bb

Browse files
committed
fix Rename is_outbound to is_initiator
In begin_interactive_funding_tx_construction(), rename is_outbound to is_initiator, to prevent confusion with earlier the role at channel open.
1 parent 915a9be commit fa482bb

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lightning/src/ln/channel.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2586,7 +2586,7 @@ impl<'a, SP: Deref> NegotiatingChannelView<'a, SP> where SP::Target: SignerProvi
25862586
#[allow(dead_code)] // TODO(dual_funding): Remove once contribution to V2 channels is enabled
25872587
fn begin_interactive_funding_tx_construction<ES: Deref>(
25882588
&mut self, signer_provider: &SP, entropy_source: &ES, holder_node_id: PublicKey,
2589-
is_outbound: bool, change_destination_opt: Option<ScriptBuf>,
2589+
is_initiator: bool, change_destination_opt: Option<ScriptBuf>,
25902590
prev_funding_input: Option<(TxIn, TransactionU16LenLimited)>,
25912591
) -> Result<Option<InteractiveTxMessageSend>, AbortReason>
25922592
where ES::Target: EntropySource
@@ -2602,7 +2602,7 @@ impl<'a, SP: Deref> NegotiatingChannelView<'a, SP> where SP::Target: SignerProvi
26022602
let mut funding_inputs = Vec::new();
26032603
mem::swap(&mut self.funding_negotiation_context.our_funding_inputs, &mut funding_inputs);
26042604

2605-
if is_outbound {
2605+
if is_initiator {
26062606
if let Some(prev_funding_input) = prev_funding_input {
26072607
funding_inputs.push(prev_funding_input);
26082608
}
@@ -2619,7 +2619,7 @@ impl<'a, SP: Deref> NegotiatingChannelView<'a, SP> where SP::Target: SignerProvi
26192619
script_pubkey: self.funding.get_funding_redeemscript().to_p2wsh(),
26202620
};
26212621

2622-
if is_outbound {
2622+
if is_initiator {
26232623
funding_outputs.push(
26242624
OutputOwned::Shared(SharedOwnedOutput::new(
26252625
shared_funding_output, self.funding_negotiation_context.our_funding_satoshis,
@@ -2638,7 +2638,7 @@ impl<'a, SP: Deref> NegotiatingChannelView<'a, SP> where SP::Target: SignerProvi
26382638
.map_err(|_err| AbortReason::InternalError("Error getting destination script"))?
26392639
};
26402640
let change_value_opt = calculate_change_output_value(
2641-
self.funding.is_outbound(), self.funding_negotiation_context.our_funding_satoshis,
2641+
is_initiator, self.funding_negotiation_context.our_funding_satoshis,
26422642
&funding_inputs, &funding_outputs,
26432643
self.funding_negotiation_context.funding_feerate_sat_per_1000_weight,
26442644
change_script.minimal_non_dust().to_sat(),
@@ -2664,7 +2664,7 @@ impl<'a, SP: Deref> NegotiatingChannelView<'a, SP> where SP::Target: SignerProvi
26642664
counterparty_node_id: self.context.counterparty_node_id,
26652665
channel_id: self.context.channel_id(),
26662666
feerate_sat_per_kw: self.funding_negotiation_context.funding_feerate_sat_per_1000_weight,
2667-
is_initiator: self.funding.is_outbound(),
2667+
is_initiator,
26682668
funding_tx_locktime: self.funding_negotiation_context.funding_tx_locktime,
26692669
inputs_to_contribute: funding_inputs,
26702670
outputs_to_contribute: funding_outputs,

0 commit comments

Comments
 (0)