plugins/pay: don't crash if getroute is empty.

This can't happen because we go the self-pay path in this case, but
once we fix that for bolt12, this can be reached.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2024-07-09 18:05:44 +09:30 committed by Vincenzo Palazzo
parent 162ebe2a72
commit ec2b626630

View File

@ -954,6 +954,7 @@ static struct command_result *payment_getroute(struct payment *p)
payment_root(p)->abort = true;
payment_fail(p, "Empty route returned by getroute, are you "
"trying to pay yourself?");
return command_still_pending(p->cmd);
}
fee = payment_route_fee(p);