From 65549a293197894c641831c3c5b051a9f3724e8e Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Tue, 16 Aug 2022 15:35:08 +0200 Subject: [PATCH] ld: Fix a log message assuming that the `channel->scid` was set This is no longer true after we introduce `zeroconf`, so use the alias local alias instead if not set. Signed-off-by: Christian Decker <@cdecker> --- lightningd/peer_htlcs.c | 9 +++++++-- tests/test_opening.py | 1 - 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lightningd/peer_htlcs.c b/lightningd/peer_htlcs.c index 80d81745c..a9d74e6c9 100644 --- a/lightningd/peer_htlcs.c +++ b/lightningd/peer_htlcs.c @@ -660,6 +660,7 @@ static void forward_htlc(struct htlc_in *hin, struct lightningd *ld = hin->key.channel->peer->ld; struct channel *next; struct htlc_out *hout = NULL; + struct short_channel_id *altscid; /* This is a shortcut for specifying next peer; doesn't mean * the actual channel! */ @@ -687,10 +688,14 @@ static void forward_htlc(struct htlc_in *hin, channel->channel_info.their_config.htlc_minimum)) continue; + altscid = channel->scid != NULL ? channel->scid + : channel->alias[LOCAL]; + /* OK, it's better! */ log_debug(next->log, "Chose a better channel: %s", - type_to_string(tmpctx, struct short_channel_id, - channel->scid)); + type_to_string(tmpctx, + struct short_channel_id, + altscid)); next = channel; } } diff --git a/tests/test_opening.py b/tests/test_opening.py index edad2f181..abbdac365 100644 --- a/tests/test_opening.py +++ b/tests/test_opening.py @@ -1577,7 +1577,6 @@ def test_scid_alias_private(node_factory, bitcoind): l1.rpc.waitsendpay(inv['payment_hash']) -@pytest.mark.xfail("Reproducing a crash", strict=True) def test_zeroconf_multichan_forward(node_factory): """The freedom to choose the forward channel bytes us when it is 0conf