fix WALLET initialisation

This commit is contained in:
dni ⚡
2022-10-05 13:05:09 +02:00
parent 030d3b34d8
commit c845502f28
8 changed files with 23 additions and 11 deletions
+3 -1
View File
@@ -15,7 +15,7 @@ from lnbits.core.crud import (
get_standalone_payment,
)
from lnbits.core.services import redeem_lnurl_withdraw
from lnbits.settings import WALLET
from lnbits.settings import get_wallet_class
from .core import db
@@ -79,6 +79,7 @@ async def webhook_handler():
"""
Returns the webhook_handler for the selected wallet if present. Used by API.
"""
WALLET = get_wallet_class()
handler = getattr(WALLET, "webhook_listener", None)
if handler:
return await handler()
@@ -108,6 +109,7 @@ async def invoice_listener():
Called by the app startup sequence.
"""
WALLET = get_wallet_class()
async for checking_id in WALLET.paid_invoices_stream():
logger.info("> got a payment notification", checking_id)
asyncio.create_task(invoice_callback_dispatcher(checking_id))