mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-03 18:57:06 +01:00
gossipd: Use the remote alias if no real scid is known
This is for the local channel announcement that'll not leave this host, as it doesn't have signatures.
This commit is contained in:
parent
3e57d6f9d0
commit
bf44178047
1 changed files with 12 additions and 1 deletions
|
@ -348,15 +348,26 @@ void tell_gossipd_local_private_channel(struct lightningd *ld,
|
||||||
struct amount_sat capacity,
|
struct amount_sat capacity,
|
||||||
const u8 *features)
|
const u8 *features)
|
||||||
{
|
{
|
||||||
|
/* Which short_channel_id should we use to refer to this channel when
|
||||||
|
* creating invoices? */
|
||||||
|
const struct short_channel_id *scid;
|
||||||
|
|
||||||
/* As we're shutting down, ignore */
|
/* As we're shutting down, ignore */
|
||||||
if (!ld->gossip)
|
if (!ld->gossip)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (channel->scid != NULL) {
|
||||||
|
scid = channel->scid;
|
||||||
|
} else {
|
||||||
|
scid = channel->alias[REMOTE];
|
||||||
|
}
|
||||||
|
|
||||||
|
assert(scid != NULL);
|
||||||
subd_send_msg(ld->gossip,
|
subd_send_msg(ld->gossip,
|
||||||
take(towire_gossipd_local_private_channel
|
take(towire_gossipd_local_private_channel
|
||||||
(NULL, &channel->peer->id,
|
(NULL, &channel->peer->id,
|
||||||
capacity,
|
capacity,
|
||||||
channel->scid,
|
scid,
|
||||||
features)));
|
features)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue