Browse Source

lndrest: two small fixes.

atmext
fiatjaf 4 years ago
parent
commit
4e68a0e7e6
  1. 4
      lnbits/wallets/lndrest.py

4
lnbits/wallets/lndrest.py

@ -81,12 +81,12 @@ class LndRestWallet(Wallet):
url=f"{self.endpoint}/v1/invoice/{checking_id}", headers=self.auth_invoice, verify=self.auth_cert, 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 # 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 # it will return an error and no "settled" attribute on the object
return PaymentStatus(None) return PaymentStatus(None)
return PaymentStatus(r.json()["settled"]) return PaymentStatus(True)
def get_payment_status(self, checking_id: str) -> PaymentStatus: def get_payment_status(self, checking_id: str) -> PaymentStatus:
r = httpx.get( r = httpx.get(

Loading…
Cancel
Save