Skip to content

Commit dd0e08f

Browse files
committed
fix Never change is_outbound in FundingScope
1 parent e17baa7 commit dd0e08f

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
@@ -1957,7 +1957,7 @@ impl FundingScope {
19571957

19581958
/// Construct FundingScope for a splicing channel
19591959
#[cfg(splicing)]
1960-
pub fn for_splice<SP: Deref>(prev_funding: &Self, context: &ChannelContext<SP>, our_funding_satoshis: u64, post_channel_value: u64, is_initiator: bool, counterparty_funding_pubkey: PublicKey) -> Self where SP::Target: SignerProvider {
1960+
pub fn for_splice<SP: Deref>(prev_funding: &Self, context: &ChannelContext<SP>, our_funding_satoshis: u64, post_channel_value: u64, counterparty_funding_pubkey: PublicKey) -> Self where SP::Target: SignerProvider {
19611961
let post_value_to_self_msat = prev_funding.value_to_self_msat.saturating_add(our_funding_satoshis);
19621962

19631963
let prev_funding_txid = prev_funding.channel_transaction_parameters.funding_outpoint
@@ -1973,8 +1973,8 @@ impl FundingScope {
19731973
let mut post_channel_transaction_parameters = ChannelTransactionParameters {
19741974
holder_pubkeys,
19751975
holder_selected_contest_delay: prev_funding.channel_transaction_parameters.holder_selected_contest_delay,
1976-
// The 'outbound' attribute may change, if the the splice is being initiated by the previous acceptor
1977-
is_outbound_from_holder: is_initiator,
1976+
// The 'outbound' attribute doesn't change, even if the splice initiator is the other node
1977+
is_outbound_from_holder: prev_funding.channel_transaction_parameters.is_outbound_from_holder,
19781978
counterparty_parameters: prev_funding.channel_transaction_parameters.counterparty_parameters.clone(),
19791979
funding_outpoint: None, // filled later
19801980
splice_parent_funding_txid: prev_funding_txid,
@@ -9210,7 +9210,7 @@ impl<SP: Deref> FundedChannel<SP> where
92109210
false, // is_outbound
92119211
)?;
92129212

9213-
let funding_scope = FundingScope::for_splice(&self.funding, &self.context, our_funding_satoshis, post_channel_value, false, msg.funding_pubkey);
9213+
let funding_scope = FundingScope::for_splice(&self.funding, &self.context, our_funding_satoshis, post_channel_value, msg.funding_pubkey);
92149214

92159215
let funding_negotiation_context = FundingNegotiationContext {
92169216
our_funding_satoshis,
@@ -9305,7 +9305,7 @@ impl<SP: Deref> FundedChannel<SP> where
93059305
true, // is_outbound
93069306
)?;
93079307

9308-
let funding_scope = FundingScope::for_splice(&self.funding, &self.context, our_funding_satoshis, post_channel_value, true, msg.funding_pubkey);
9308+
let funding_scope = FundingScope::for_splice(&self.funding, &self.context, our_funding_satoshis, post_channel_value, msg.funding_pubkey);
93099309

93109310
let pre_funding_transaction = &self.funding.funding_transaction;
93119311
let pre_funding_txo = &self.funding.get_funding_txo();

0 commit comments

Comments
 (0)