mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +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:
committed by
Rusty Russell
parent
8252ac5a6e
commit
2e51afcc50
@@ -1521,6 +1521,11 @@ static void paystatus_add_payment(struct json_stream *s, const struct payment *p
|
|||||||
/* TODO Add routehint. */
|
/* TODO Add routehint. */
|
||||||
/* TODO Add route details */
|
/* 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) {
|
if (p->step == PAYMENT_STEP_SPLIT) {
|
||||||
/* Don't add anything, this is neither a success nor a failure. */
|
/* Don't add anything, this is neither a success nor a failure. */
|
||||||
} else if (p->result != NULL) {
|
} 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_object_start(s, "failure");
|
||||||
json_add_sendpay_result(s, p->result);
|
json_add_sendpay_result(s, p->result);
|
||||||
json_object_end(s);
|
json_object_end(s);
|
||||||
} else {
|
} else if (p->step >= PAYMENT_STEP_SPLIT) {
|
||||||
json_object_start(s, "failure");
|
json_object_start(s, "failure");
|
||||||
json_add_num(s, "code", PAY_ROUTE_NOT_FOUND);
|
json_add_num(s, "code", PAY_ROUTE_NOT_FOUND);
|
||||||
json_add_string(s, "message", "Call to getroute: Could not find a route");
|
json_add_string(s, "message", "Call to getroute: Could not find a route");
|
||||||
|
|||||||
Reference in New Issue
Block a user