test: fix lndrest on regtest (#2811)

* fix: lndrest on regtest
* fix some race conditions on lndrest
This commit is contained in:
dni ⚡
2024-12-12 07:54:43 +01:00
committed by GitHub
parent 61c71660b8
commit 1b9bb32ca0
6 changed files with 19 additions and 11 deletions
+9 -3
View File
@@ -159,9 +159,15 @@ class LndRestNode(Node):
timeout=None,
) as stream:
async for chunk in stream.aiter_text():
if chunk:
chunk = json.loads(chunk)
logger.info(f"LND Channel close update: {chunk['result']}")
if not chunk:
continue
chunk = json.loads(chunk)
if "error" in chunk:
raise HTTPException(
status_code=HTTPStatus.INTERNAL_SERVER_ERROR,
detail=chunk["error"].get("message"),
)
logger.info(f"LND Channel close update: {chunk.get('result')}")
async def close_channel(
self,