From f2ea8a0c748a54e9b49e5e25675795a75c56d031 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Mon, 12 Oct 2020 23:16:16 -0300 Subject: [PATCH] fix lndrest payment checking: b64/hex mismatch. finally fixes https://github.com/lnbits/lnbits/issues/55 and https://github.com/lnbits/lnbits/issues/110 --- lnbits/wallets/lndrest.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lnbits/wallets/lndrest.py b/lnbits/wallets/lndrest.py index b6e22ba..2013a33 100644 --- a/lnbits/wallets/lndrest.py +++ b/lnbits/wallets/lndrest.py @@ -131,6 +131,10 @@ class LndRestWallet(Wallet): # https://api.lightning.community/rest/index.html?python#peersynctype statuses = {"UNKNOWN": None, "IN_FLIGHT": None, "SUCCEEDED": True, "FAILED": False} + # for some reason our checking_ids are in base64 but the payment hashes + # returned here are in hex, lnd is weird + checking_id = base64.b64decode(checking_id).hex() + for p in r.json()["payments"]: if p["payment_hash"] == checking_id: return PaymentStatus(statuses[p["status"]])