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

@@ -3228,9 +3228,17 @@ static struct command_result *direct_pay_listpeers(struct command *cmd,
if (!streq(chan->state, "CHANNELD_NORMAL"))
continue;
/* Must have either a local alias for zeroconf
* channels or a final scid. */
assert(chan->alias[LOCAL] || chan->scid);
d->chan = tal(d, struct short_channel_id_dir);
d->chan->scid = *chan->scid;
d->chan->dir = *chan->direction;
if (chan->scid) {
d->chan->scid = *chan->scid;
d->chan->dir = *chan->direction;
} else {
d->chan->scid = *chan->alias[LOCAL];
d->chan->dir = 0; /* Don't care. */
}
}
}
cont: