Skip to content

Use inbound SCID alias for blinded path creation #3902

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lightning/src/ln/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9403,6 +9403,12 @@ where
false
}

/// Gets the latest inbound SCID alias from our peer, or if none exists, the channel's real
/// SCID.
pub fn get_inbound_scid(&self) -> Option<u64> {
self.context.latest_inbound_scid_alias.or(self.funding.get_short_channel_id())
}

/// Returns true if our channel_ready has been sent
pub fn is_our_channel_ready(&self) -> bool {
matches!(self.context.channel_state, ChannelState::AwaitingChannelReady(flags) if flags.is_set(AwaitingChannelReadyFlags::OUR_CHANNEL_READY))
Expand Down
5 changes: 3 additions & 2 deletions lightning/src/ln/channelmanager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11524,8 +11524,9 @@ where
.channel_by_id
.iter()
.filter(|(_, channel)| channel.context().is_usable())
.min_by_key(|(_, channel)| channel.context().channel_creation_height)
.and_then(|(_, channel)| channel.funding().get_short_channel_id()),
.filter_map(|(_, channel)| channel.as_funded())
.min_by_key(|funded_channel| funded_channel.context.channel_creation_height)
.and_then(|funded_channel| funded_channel.get_inbound_scid()),
})
.collect::<Vec<_>>()
}
Expand Down
Loading