diff --git a/plugins/xpay/listpays.c b/plugins/xpay/listpays.c index e1c9de5a8..020fb2968 100644 --- a/plugins/xpay/listpays.c +++ b/plugins/xpay/listpays.c @@ -159,7 +159,8 @@ static void add_new_entry(struct plugin *plugin, if (pm->state & PAYMENT_COMPLETE) json_add_string(ret, "status", "complete"); - else if (pm->state & PAYMENT_PENDING || attempt_ongoing(plugin, pm->payment_hash)) + else if (pm->state & PAYMENT_PENDING || + attempt_ongoing(plugin, pm->payment_hash, pm->sortkey.groupid)) json_add_string(ret, "status", "pending"); else json_add_string(ret, "status", "failed"); diff --git a/plugins/xpay/xpay.c b/plugins/xpay/xpay.c index 7cf2c2061..d9a3c297f 100644 --- a/plugins/xpay/xpay.c +++ b/plugins/xpay/xpay.c @@ -2510,13 +2510,15 @@ static struct payment *new_payment(const tal_t *ctx, return payment; } -bool attempt_ongoing(struct plugin *plugin, const struct sha256 *payment_hash) +bool attempt_ongoing(struct plugin *plugin, const struct sha256 *payment_hash, + u64 groupid) { struct xpay *xpay = xpay_of(plugin); const struct payment *payment; list_for_each(&xpay->payments, payment, list) { - if (sha256_eq(&payment->payment_hash, payment_hash)) + if (sha256_eq(&payment->payment_hash, payment_hash) && + payment->group_id == groupid) return true; } return false; diff --git a/plugins/xpay/xpay.h b/plugins/xpay/xpay.h index 886380d5c..44d4305ae 100644 --- a/plugins/xpay/xpay.h +++ b/plugins/xpay/xpay.h @@ -7,6 +7,7 @@ struct plugin; struct sha256; /* Are we still attempting this payment? If so, we won't list is as failed. */ -bool attempt_ongoing(struct plugin *plugin, const struct sha256 *payment_hash); +bool attempt_ongoing(struct plugin *plugin, const struct sha256 *payment_hash, + u64 groupid); #endif /* LIGHTNING_PLUGINS_XPAY_XPAY_H */