diff --git a/cashu/lightning/corelightningrest.py b/cashu/lightning/corelightningrest.py index 1f02dfc4..4503f6a0 100644 --- a/cashu/lightning/corelightningrest.py +++ b/cashu/lightning/corelightningrest.py @@ -70,7 +70,7 @@ async def cleanup(self): logger.warning(f"Error closing wallet connection: {e}") async def status(self) -> StatusResponse: - r = await self.client.get(f"{self.url}/v1/channel/localremotebal", timeout=5) + r = await self.client.get(f"{self.url}/v1/listFunds", timeout=5) r.raise_for_status() if r.is_error or "error" in r.json(): try: @@ -88,7 +88,7 @@ async def status(self) -> StatusResponse: data = r.json() if len(data) == 0: return StatusResponse(error_message="no data", balance=0) - balance_msat = int(data.get("localBalance") * 1000) + balance_msat = int(sum([c["our_amount_msat"] for c in data["channels"]])) return StatusResponse(error_message=None, balance=balance_msat) async def create_invoice(