payalgo: Remove reporting PAY_TRY_ANOTHER_ROUTE and PAY_UNPARSEABLE_ONION.

These error codes will cause `pay` to retry, so `pay` will never
actually report those error codes.
Those error codes will only get reported at the `sendpay` level.
This commit is contained in:
ZmnSCPxj
2018-02-25 23:56:44 +00:00
committed by Christian Decker
parent 694fb41ef6
commit 6c9d81ef42
3 changed files with 15 additions and 47 deletions

View File

@@ -77,21 +77,11 @@ static void json_pay_failure(struct command *cmd,
break;
case PAY_UNPARSEABLE_ONION:
data = new_json_result(cmd);
json_object_start(data, NULL);
json_add_hex(data, "onionreply",
r->onionreply, tal_len(r->onionreply));
json_object_end(data);
msg = tal_fmt(cmd,
"failed: WIRE_PERMANENT_NODE_FAILURE "
"(%s)",
r->details);
/* Impossible case */
abort();
break;
case PAY_DESTINATION_PERM_FAIL:
case PAY_TRY_OTHER_ROUTE:
fail = r->routing_failure;
data = new_json_result(cmd);
@@ -117,6 +107,11 @@ static void json_pay_failure(struct command *cmd,
r->details);
break;
case PAY_TRY_OTHER_ROUTE:
/* Impossible case */
abort();
break;
}
assert(msg);