invoice: Consider aliases too when selecting routehints

This commit is contained in:
Christian Decker
2022-04-28 17:55:15 +02:00
parent 78c9c6a9e0
commit 1ae3dba529
7 changed files with 65 additions and 5 deletions

View File

@@ -106,6 +106,15 @@ routehint_candidates(const tal_t *ctx,
/* Check channel is in CHANNELD_NORMAL */
candidate.c = find_channel_by_scid(peer, &r->short_channel_id);
/* Try seeing if we should be using a remote alias
* instead. The `listpeers` result may have returned
* the REMOTE alias, because it is the only scid we
* have, and it is mandatory once the channel is in
* CHANNELD_NORMAL. */
if (!candidate.c)
candidate.c = find_channel_by_alias(peer, &r->short_channel_id, REMOTE);
if (!candidate.c) {
log_debug(ld->log, "%s: channel not found in peer %s",
type_to_string(tmpctx,