From 3e57d6f9d0f58841e5a61f9d89cb855fb5913bd4 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Tue, 26 Apr 2022 14:39:30 +0200 Subject: [PATCH] channeld: On funding_locked, remember either alias or real scid --- channeld/channeld.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/channeld/channeld.c b/channeld/channeld.c index cadc6c00e..af0f20988 100644 --- a/channeld/channeld.c +++ b/channeld/channeld.c @@ -3235,8 +3235,14 @@ static void handle_funding_depth(struct peer *peer, const u8 *msg) } else { peer->depth_togo = 0; - assert(scid); - peer->short_channel_ids[LOCAL] = *scid; + /* If we know an actual short_channel_id prefer to use + * that, otherwise fill in the alias. From channeld's + * point of view switching from zeroconf to an actual + * funding scid is just a reorg. */ + if (scid) + peer->short_channel_ids[LOCAL] = *scid; + else if (alias_local) + peer->short_channel_ids[LOCAL] = *alias_local; if (!peer->funding_locked[LOCAL]) { status_debug("funding_locked: sending commit index"