mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-22 14:42:40 +01:00
pay: Do not mark in-flight parts as failed
Changelog-Fixed: pay: `pay` was reporting in-flight parts as failed
This commit is contained in:
parent
8252ac5a6e
commit
2e51afcc50
1 changed files with 6 additions and 1 deletions
|
@ -1521,6 +1521,11 @@ static void paystatus_add_payment(struct json_stream *s, const struct payment *p
|
|||
/* TODO Add routehint. */
|
||||
/* TODO Add route details */
|
||||
|
||||
if (p->step < PAYMENT_STEP_SPLIT)
|
||||
json_add_string(s, "state", "pending");
|
||||
else
|
||||
json_add_string(s, "state", "completed");
|
||||
|
||||
if (p->step == PAYMENT_STEP_SPLIT) {
|
||||
/* Don't add anything, this is neither a success nor a failure. */
|
||||
} else if (p->result != NULL) {
|
||||
|
@ -1530,7 +1535,7 @@ static void paystatus_add_payment(struct json_stream *s, const struct payment *p
|
|||
json_object_start(s, "failure");
|
||||
json_add_sendpay_result(s, p->result);
|
||||
json_object_end(s);
|
||||
} else {
|
||||
} else if (p->step >= PAYMENT_STEP_SPLIT) {
|
||||
json_object_start(s, "failure");
|
||||
json_add_num(s, "code", PAY_ROUTE_NOT_FOUND);
|
||||
json_add_string(s, "message", "Call to getroute: Could not find a route");
|
||||
|
|
Loading…
Add table
Reference in a new issue