Skip to content

Commit bd56ddf

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 1788f80 commit bd56ddf

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
@@ -2332,7 +2332,9 @@ where L::Target: Logger {
23322332
})?;
23332333

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

0 commit comments

Comments
 (0)