From 5e7404850848c2035550f051c3efb3551ecc7b8d Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Tue, 26 Apr 2022 14:53:58 +0200 Subject: [PATCH] gossip: Add both channel directions with their respective alias We locally generate an update with our local alias, and get one from the peer with the remote alias, so we need to add them both. We do so only if using the alias in the first place though. --- lightningd/channel_control.c | 8 +++----- lightningd/gossip_control.c | 12 ++++++++++++ 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/lightningd/channel_control.c b/lightningd/channel_control.c index 39f5c9351..de837a41c 100644 --- a/lightningd/channel_control.c +++ b/lightningd/channel_control.c @@ -785,11 +785,9 @@ void peer_start_channeld(struct channel *channel, } /* Artificial confirmation event for zeroconf */ - if (channel_type_has(channel->type, OPT_ZEROCONF)) - subd_send_msg( - channel->owner, - take(towire_channeld_funding_depth( - NULL, channel->scid, channel->alias[LOCAL], 0))); + subd_send_msg(channel->owner, + take(towire_channeld_funding_depth( + NULL, channel->scid, channel->alias[LOCAL], 0))); } bool channel_tell_depth(struct lightningd *ld, diff --git a/lightningd/gossip_control.c b/lightningd/gossip_control.c index 51a3cd789..0de65d194 100644 --- a/lightningd/gossip_control.c +++ b/lightningd/gossip_control.c @@ -369,6 +369,18 @@ void tell_gossipd_local_private_channel(struct lightningd *ld, capacity, scid, features))); + + /* If we have no real scid, and there are two different + * aliases, then we need to add both as single direction + * channels to the local gossip_store. */ + if ((!channel->scid && channel->alias[LOCAL]) && + !short_channel_id_eq(channel->alias[REMOTE], + channel->alias[LOCAL])) { + subd_send_msg(ld->gossip, + take(towire_gossipd_local_private_channel( + NULL, &channel->peer->id, capacity, + channel->alias[LOCAL], features))); + } } static struct command_result *json_setleaserates(struct command *cmd,