xpay: fix misleading "route hint" label in error messages

describe_scidd() was labeling any channel as "the invoice's route hint"
when there was a single-hop route hint, even if the error occurred on
an unrelated intermediate channel.

Now we check the channel actually matches the route hint's
short_channel_id before using that label.

Fixes: #8252
Changelog-Fixed: xpay: error messages no longer incorrectly label intermediate channels as "the invoice's route hint".
This commit is contained in:
wqxoxo
2025-11-28 16:28:32 +00:00
committed by Rusty Russell
parent 9d4a150b7f
commit 3c08a8bdb9

View File

@@ -522,7 +522,9 @@ static const char *describe_scidd(struct attempt *attempt, size_t index)
/* Routehint? Often they are a single hop. */
if (tal_count(payment->route_hints) == 1
&& tal_count(payment->route_hints[0]) == 1)
&& tal_count(payment->route_hints[0]) == 1
&& short_channel_id_eq(scidd.scid,
payment->route_hints[0][0].short_channel_id))
return tal_fmt(tmpctx, "the invoice's route hint (%s)",
fmt_short_channel_id_dir(tmpctx, &scidd));