ld: Consider local aliases when forwarding

This commit is contained in:
Christian Decker 2022-04-28 17:57:55 +02:00
parent 1ae3dba529
commit a4e6b58fa4
2 changed files with 8 additions and 0 deletions

View File

@ -600,6 +600,11 @@ struct channel *any_channel_by_scid(struct lightningd *ld,
if (chan->scid
&& short_channel_id_eq(scid, chan->scid))
return chan;
/* We also want to find the channel by its local alias
* when we forward. */
if (chan->alias[LOCAL] &&
short_channel_id_eq(scid, chan->alias[LOCAL]))
return chan;
}
}
return NULL;

View File

@ -1629,6 +1629,9 @@ static struct listpeers_channel *json_to_listpeers_channel(const tal_t *ctx,
chan->alias[REMOTE]);
} else
chan->alias[REMOTE] = NULL;
} else {
chan->alias[LOCAL] = NULL;
chan->alias[REMOTE] = NULL;
}
json_to_msat(buffer, tmsattok, &chan->total_msat);