From 39066e4bc880e0070430c5499c907b554556ff01 Mon Sep 17 00:00:00 2001 From: daywalker90 Date: Mon, 22 May 2023 13:03:37 +0200 Subject: [PATCH] fix cln wallet for msat migration (#1671) * fix cln wallet for msat migration * status wants our funds only --- lnbits/wallets/cln.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lnbits/wallets/cln.py b/lnbits/wallets/cln.py index 642aef508..7052df483 100644 --- a/lnbits/wallets/cln.py +++ b/lnbits/wallets/cln.py @@ -69,7 +69,7 @@ class CoreLightningWallet(Wallet): try: funds = self.ln.listfunds() return StatusResponse( - None, sum([ch["channel_sat"] * 1000 for ch in funds["channels"]]) + None, sum([int(ch["our_amount_msat"]) for ch in funds["channels"]]) ) except RpcError as exc: error_message = f"lightningd '{exc.method}' failed with '{exc.error}'." @@ -141,7 +141,7 @@ class CoreLightningWallet(Wallet): except Exception as exc: return PaymentResponse(False, None, None, None, str(exc)) - fee_msat = -int(r["msatoshi_sent"] - r["msatoshi"]) + fee_msat = -int(r["amount_sent_msat"] - r["amount_msat"]) return PaymentResponse( True, r["payment_hash"], fee_msat, r["payment_preimage"], None )