mirror of
https://github.com/lnbits/lnbits.git
synced 2025-09-26 11:56:16 +02:00
fix cln wallet for msat migration (#1671)
* fix cln wallet for msat migration * status wants our funds only
This commit is contained in:
@@ -69,7 +69,7 @@ class CoreLightningWallet(Wallet):
|
|||||||
try:
|
try:
|
||||||
funds = self.ln.listfunds()
|
funds = self.ln.listfunds()
|
||||||
return StatusResponse(
|
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:
|
except RpcError as exc:
|
||||||
error_message = f"lightningd '{exc.method}' failed with '{exc.error}'."
|
error_message = f"lightningd '{exc.method}' failed with '{exc.error}'."
|
||||||
@@ -141,7 +141,7 @@ class CoreLightningWallet(Wallet):
|
|||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
return PaymentResponse(False, None, None, None, str(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(
|
return PaymentResponse(
|
||||||
True, r["payment_hash"], fee_msat, r["payment_preimage"], None
|
True, r["payment_hash"], fee_msat, r["payment_preimage"], None
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user