fix WALLET initialisation
This commit is contained in:
+3
-1
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user