From 2f381960a07d62e5da16e721bedd77e881095b82 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Tue, 5 Apr 2022 08:44:38 -0300 Subject: [PATCH] fix sparko invoice checking ("expired" was being considered as "paid"). --- lnbits/wallets/spark.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lnbits/wallets/spark.py b/lnbits/wallets/spark.py index 9404de6fb..00bf6d3cf 100644 --- a/lnbits/wallets/spark.py +++ b/lnbits/wallets/spark.py @@ -152,9 +152,11 @@ class SparkWallet(Wallet): if not r or not r.get("invoices"): return PaymentStatus(None) - if r["invoices"][0]["status"] == "unpaid": + + if r["invoices"][0]["status"] == "paid": + return PaymentStatus(True) + else: return PaymentStatus(False) - return PaymentStatus(True) async def get_payment_status(self, checking_id: str) -> PaymentStatus: # check if it's 32 bytes hex