mirror of
https://github.com/lnbits/lnbits.git
synced 2025-06-29 10:10:00 +02:00
CLN: return payment failure if no payment is found (#2113)
* CLN: return payment failure if no payment is found
This commit is contained in:
@ -169,8 +169,12 @@ class CoreLightningWallet(Wallet):
|
|||||||
r: dict = self.ln.listpays(payment_hash=checking_id) # type: ignore
|
r: dict = self.ln.listpays(payment_hash=checking_id) # type: ignore
|
||||||
except Exception:
|
except Exception:
|
||||||
return PaymentStatus(None)
|
return PaymentStatus(None)
|
||||||
if "pays" not in r or not r["pays"]:
|
if "pays" not in r:
|
||||||
return PaymentStatus(None)
|
return PaymentStatus(None)
|
||||||
|
if not r["pays"]:
|
||||||
|
# no payment with this payment_hash is found
|
||||||
|
return PaymentStatus(False)
|
||||||
|
|
||||||
payment_resp = r["pays"][-1]
|
payment_resp = r["pays"][-1]
|
||||||
|
|
||||||
if payment_resp["payment_hash"] == checking_id:
|
if payment_resp["payment_hash"] == checking_id:
|
||||||
|
Reference in New Issue
Block a user