Skip to content

Commit 22c3433

Browse files
authored
Merge pull request #3902 from TheBlueMatt/2025-06-bp-scid-alias
Use inbound SCID alias for blinded path creation
2 parents 34664bc + 549df3e commit 22c3433

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

lightning/src/ln/channel.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9405,6 +9405,12 @@ where
94059405
false
94069406
}
94079407

9408+
/// Gets the latest inbound SCID alias from our peer, or if none exists, the channel's real
9409+
/// SCID.
9410+
pub fn get_inbound_scid(&self) -> Option<u64> {
9411+
self.context.latest_inbound_scid_alias.or(self.funding.get_short_channel_id())
9412+
}
9413+
94089414
/// Returns true if our channel_ready has been sent
94099415
pub fn is_our_channel_ready(&self) -> bool {
94109416
matches!(self.context.channel_state, ChannelState::AwaitingChannelReady(flags) if flags.is_set(AwaitingChannelReadyFlags::OUR_CHANNEL_READY))

lightning/src/ln/channelmanager.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11524,8 +11524,9 @@ where
1152411524
.channel_by_id
1152511525
.iter()
1152611526
.filter(|(_, channel)| channel.context().is_usable())
11527-
.min_by_key(|(_, channel)| channel.context().channel_creation_height)
11528-
.and_then(|(_, channel)| channel.funding().get_short_channel_id()),
11527+
.filter_map(|(_, channel)| channel.as_funded())
11528+
.min_by_key(|funded_channel| funded_channel.context.channel_creation_height)
11529+
.and_then(|funded_channel| funded_channel.get_inbound_scid()),
1152911530
})
1153011531
.collect::<Vec<_>>()
1153111532
}

0 commit comments

Comments
 (0)