This commit is contained in:
arcbtc
2026-01-23 00:41:18 +00:00
parent 0e69aa536d
commit 2bd398b59c
+7 -12
View File
@@ -2,7 +2,7 @@ import asyncio
import hashlib import hashlib
import json import json
from collections.abc import AsyncGenerator from collections.abc import AsyncGenerator
from typing import Any from typing import Any, cast
import httpx import httpx
from bolt11 import decode as bolt11_decode from bolt11 import decode as bolt11_decode
@@ -38,15 +38,9 @@ class LightsparkSparkWallet(Wallet):
""" """
def __init__(self): def __init__(self):
super().__init__() self.pending_invoices: list[str] = []
self.endpoint = normalize_endpoint( self.endpoint = normalize_endpoint(cast(str, settings.spark_l2_endpoint))
getattr(settings, "spark_l2_endpoint", None) api_key = settings.spark_l2_api_key
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
)
headers = {"User-Agent": settings.user_agent} headers = {"User-Agent": settings.user_agent}
if api_key: if api_key:
headers["X-Api-Key"] = api_key headers["X-Api-Key"] = api_key
@@ -275,8 +269,9 @@ class LightsparkSparkWallet(Wallet):
continue continue
data = json.loads(line[5:].strip()) data = json.loads(line[5:].strip())
checking_id = data.get("checking_id") checking_id = data.get("checking_id")
if checking_id: if not checking_id:
yield checking_id continue
yield checking_id
except Exception as exc: except Exception as exc:
logger.error( logger.error(
"lost connection to Spark sidecar invoice stream: " "lost connection to Spark sidecar invoice stream: "