mirror of
https://github.com/lnbits/lnbits.git
synced 2026-08-19 13:27:39 +02:00
fixes
This commit is contained in:
parent
0e69aa536d
commit
2bd398b59c
1 changed files with 7 additions and 12 deletions
|
|
@ -2,7 +2,7 @@ import asyncio
|
|||
import hashlib
|
||||
import json
|
||||
from collections.abc import AsyncGenerator
|
||||
from typing import Any
|
||||
from typing import Any, cast
|
||||
|
||||
import httpx
|
||||
from bolt11 import decode as bolt11_decode
|
||||
|
|
@ -38,15 +38,9 @@ class LightsparkSparkWallet(Wallet):
|
|||
"""
|
||||
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.endpoint = normalize_endpoint(
|
||||
getattr(settings, "spark_l2_endpoint", None)
|
||||
or getattr(settings, "SPARK_L2_ENDPOINT", None)
|
||||
or "http://127.0.0.1:8765"
|
||||
)
|
||||
api_key = getattr(settings, "spark_l2_api_key", None) or getattr(
|
||||
settings, "SPARK_L2_API_KEY", None
|
||||
)
|
||||
self.pending_invoices: list[str] = []
|
||||
self.endpoint = normalize_endpoint(cast(str, settings.spark_l2_endpoint))
|
||||
api_key = settings.spark_l2_api_key
|
||||
headers = {"User-Agent": settings.user_agent}
|
||||
if api_key:
|
||||
headers["X-Api-Key"] = api_key
|
||||
|
|
@ -275,8 +269,9 @@ class LightsparkSparkWallet(Wallet):
|
|||
continue
|
||||
data = json.loads(line[5:].strip())
|
||||
checking_id = data.get("checking_id")
|
||||
if checking_id:
|
||||
yield checking_id
|
||||
if not checking_id:
|
||||
continue
|
||||
yield checking_id
|
||||
except Exception as exc:
|
||||
logger.error(
|
||||
"lost connection to Spark sidecar invoice stream: "
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue