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

@@ -664,6 +664,18 @@ struct channel *find_channel_by_scid(const struct peer *peer,
return NULL;
}
struct channel *find_channel_by_alias(const struct peer *peer,
const struct short_channel_id *alias,
enum side side)
{
struct channel *c;
list_for_each(&peer->channels, c, list) {
if (c->alias[side] && short_channel_id_eq(c->alias[side], alias))
return c;
}
return NULL;
}
void channel_set_last_tx(struct channel *channel,
struct bitcoin_tx *tx,
const struct bitcoin_signature *sig,