pay: Fix another instance of a crash when we can't find ourselves

This commit is contained in:
Christian Decker 2021-06-17 17:01:39 +02:00 committed by Rusty Russell
parent 50ebdfb5e8
commit 2510bcad07

View File

@ -2633,7 +2633,7 @@ static void routehint_check_reachable(struct payment *p)
dst = gossmap_find_node(gossmap, p->destination); dst = gossmap_find_node(gossmap, p->destination);
if (dst == NULL) if (dst == NULL)
d->destination_reachable = false; d->destination_reachable = false;
else { else if (src != NULL) {
dij = dijkstra(tmpctx, gossmap, dst, AMOUNT_MSAT(1000), dij = dijkstra(tmpctx, gossmap, dst, AMOUNT_MSAT(1000),
10 / 1000000.0, 10 / 1000000.0,
payment_route_can_carry_even_disabled, payment_route_can_carry_even_disabled,
@ -2644,6 +2644,11 @@ static void routehint_check_reachable(struct payment *p)
/* If there was a route the destination is reachable /* If there was a route the destination is reachable
* without routehints. */ * without routehints. */
d->destination_reachable = r != NULL; d->destination_reachable = r != NULL;
} else {
paymod_log(p, LOG_DBG,
"Could not locate ourselves in the network. "
"Allowing direct attempts");
d->destination_reachable = true;
} }
if (d->destination_reachable) { if (d->destination_reachable) {