mirror of
https://github.com/lnbits/lnbits.git
synced 2025-04-07 19:38:13 +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:
parent
e65ec56276
commit
0eb74c86ba
@ -169,8 +169,12 @@ class CoreLightningWallet(Wallet):
|
||||
r: dict = self.ln.listpays(payment_hash=checking_id) # type: ignore
|
||||
except Exception:
|
||||
return PaymentStatus(None)
|
||||
if "pays" not in r or not r["pays"]:
|
||||
if "pays" not in r:
|
||||
return PaymentStatus(None)
|
||||
if not r["pays"]:
|
||||
# no payment with this payment_hash is found
|
||||
return PaymentStatus(False)
|
||||
|
||||
payment_resp = r["pays"][-1]
|
||||
|
||||
if payment_resp["payment_hash"] == checking_id:
|
||||
|
Loading…
x
Reference in New Issue
Block a user