Skip to content

Commit 97b880b

Browse files
committed
More completely ignore route hints which are for our own channels
When we see a channel come into the router as a route-hint, but its for a direct channel of ours, we'd like to ignore the route-hint as we have more information in the first-hop channel info. We do this by matching SCIDs, but only considered outbound SCID aliases. Here we change to consider both outbound SCID aliases and the full channel SCID, which some nodes may use in their invoices.
1 parent 5ea3aba commit 97b880b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lightning/src/routing/router.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2330,7 +2330,9 @@ where L::Target: Logger {
23302330
})?;
23312331

23322332
if let Some((first_channels, _)) = first_hop_targets.get(target) {
2333-
if first_channels.iter().any(|d| d.outbound_scid_alias == Some(hop.short_channel_id)) {
2333+
let matches_an_scid = |d: &&ChannelDetails|
2334+
d.outbound_scid_alias == Some(hop.short_channel_id) || d.short_channel_id == Some(hop.short_channel_id);
2335+
if first_channels.iter().any(matches_an_scid) {
23342336
log_trace!(logger, "Ignoring route hint with SCID {} (and any previous) due to it being a direct channel of ours.",
23352337
hop.short_channel_id);
23362338
break;

0 commit comments

Comments
 (0)