mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2025-02-23 22:47:05 +01:00
lndrest: two small fixes.
This commit is contained in:
parent
16541d40c6
commit
4e68a0e7e6
1 changed files with 2 additions and 2 deletions
|
@ -81,12 +81,12 @@ class LndRestWallet(Wallet):
|
|||
url=f"{self.endpoint}/v1/invoice/{checking_id}", headers=self.auth_invoice, verify=self.auth_cert,
|
||||
)
|
||||
|
||||
if not r or not r.json().get("settled"):
|
||||
if r.is_error or not r.json().get("settled"):
|
||||
# this must also work when checking_id is not a hex recognizable by lnd
|
||||
# it will return an error and no "settled" attribute on the object
|
||||
return PaymentStatus(None)
|
||||
|
||||
return PaymentStatus(r.json()["settled"])
|
||||
return PaymentStatus(True)
|
||||
|
||||
def get_payment_status(self, checking_id: str) -> PaymentStatus:
|
||||
r = httpx.get(
|
||||
|
|
Loading…
Add table
Reference in a new issue