pay: don't say "Could not find a route" unless we never tried a payment.

It's deeply confusing: we say this after exhausting all other routes.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2019-05-21 09:55:02 +09:30
parent aa62ae3385
commit 71460ac073
2 changed files with 12 additions and 1 deletions

View File

@@ -199,6 +199,12 @@ static struct command_result *next_routehint(struct command *cmd,
return command_fail(cmd, PAY_ROUTE_TOO_EXPENSIVE,
"%s", pc->expensive_route);
if (tal_count(pc->ps->attempts) > 1)
return command_fail(cmd, PAY_STOPPED_RETRYING,
"Ran out of routes to try after"
" %zu attempts: see paystatus",
tal_count(pc->ps->attempts));
return command_fail(cmd, PAY_ROUTE_NOT_FOUND,
"Could not find a route");
}