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>
This commit is contained in:
Christian Decker 2022-08-16 15:35:08 +02:00 committed by neil saitug
parent ab1ca7f159
commit 65549a2931
2 changed files with 7 additions and 3 deletions

View file

@ -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;
}
}

View file

@ -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