Skip to content

Commit 666993a

Browse files
committed
f - FundingLocked
1 parent c8dec26 commit 666993a

File tree

1 file changed

+4
-24
lines changed

1 file changed

+4
-24
lines changed

lightning/src/ln/channel.rs

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9767,13 +9767,6 @@ where
97679767
self.context.latest_inbound_scid_alias.or(self.funding.get_short_channel_id())
97689768
}
97699769

9770-
/// Returns true if their channel_ready has been received
9771-
#[cfg(splicing)]
9772-
pub fn is_their_channel_ready(&self) -> bool {
9773-
matches!(self.context.channel_state, ChannelState::AwaitingChannelReady(flags) if flags.is_set(AwaitingChannelReadyFlags::THEIR_CHANNEL_READY))
9774-
|| matches!(self.context.channel_state, ChannelState::ChannelReady(_))
9775-
}
9776-
97779770
/// Returns true if our channel_ready has been sent
97789771
pub fn is_our_channel_ready(&self) -> bool {
97799772
matches!(self.context.channel_state, ChannelState::AwaitingChannelReady(flags) if flags.is_set(AwaitingChannelReadyFlags::OUR_CHANNEL_READY))
@@ -10549,31 +10542,18 @@ where
1054910542
}
1055010543

1055110544
#[cfg(splicing)]
10552-
fn maybe_get_your_last_funding_locked_txid(&self) -> Option<Txid> {
10553-
self.pending_splice
10554-
.as_ref()
10555-
.and_then(|pending_splice| pending_splice.received_funding_txid)
10556-
.or_else(|| {
10557-
self.is_their_channel_ready().then(|| self.funding.get_funding_txid()).flatten()
10558-
})
10559-
}
10560-
#[cfg(not(splicing))]
10561-
fn maybe_get_your_last_funding_locked_txid(&self) -> Option<Txid> {
10562-
None
10563-
}
10564-
10565-
#[cfg(splicing)]
10566-
fn maybe_get_my_current_funding_locked_txid(&self) -> Option<Txid> {
10545+
fn maybe_get_my_current_funding_locked(&self) -> Option<msgs::FundingLocked> {
1056710546
self.pending_splice
1056810547
.as_ref()
1056910548
.and_then(|pending_splice| pending_splice.sent_funding_txid)
1057010549
.or_else(|| {
1057110550
self.is_our_channel_ready().then(|| self.funding.get_funding_txid()).flatten()
1057210551
})
10552+
.map(|txid| msgs::FundingLocked { txid, retransmit_flags: 0 })
1057310553
}
1057410554

1057510555
#[cfg(not(splicing))]
10576-
fn maybe_get_my_current_funding_locked_txid(&self) -> Option<Txid> {
10556+
fn maybe_get_my_current_funding_locked(&self) -> Option<msgs::FundingLocked> {
1057710557
None
1057810558
}
1057910559

@@ -10628,7 +10608,7 @@ where
1062810608
your_last_per_commitment_secret: remote_last_secret,
1062910609
my_current_per_commitment_point: dummy_pubkey,
1063010610
next_funding_txid: self.maybe_get_next_funding_txid(),
10631-
my_current_funding_locked_txid: self.maybe_get_my_current_funding_locked_txid(),
10611+
my_current_funding_locked: self.maybe_get_my_current_funding_locked(),
1063210612
}
1063310613
}
1063410614

0 commit comments

Comments
 (0)