pay: Fix wrong result being returned by pay

We were checking against the wrong enum value, resulting in an
erroneous `pending` state as a final result.

Changelog-Fixed: pay: `pay` would sometimes misreport a final state of `pending` instead of `failed`
This commit is contained in:
Christian Decker 2021-04-28 11:53:11 +02:00 committed by Rusty Russell
parent 91497b7ee5
commit 6ad8a8a3c9

View File

@ -1949,7 +1949,7 @@ static void payment_finished(struct payment *p)
* success. */
json_add_string(ret, "status", "complete");
} else if (result.leafstates & ~PAYMENT_FAILED) {
} else if (result.leafstates & ~PAYMENT_STEP_FAILED) {
/* If there are non-failed leafs we are still trying. */
json_add_string(ret, "status", "pending");