mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-18 22:54:25 +01:00
ld: Consider local aliases when forwarding
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user