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
1 changed files with 5 additions and 1 deletions
|
|
@ -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:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue