lnurl balanceCheck and balanceNotify.
This commit is contained in:
@@ -9,7 +9,9 @@ from lnbits.core.crud import (
|
||||
get_payments,
|
||||
get_standalone_payment,
|
||||
delete_expired_invoices,
|
||||
get_balance_checks,
|
||||
)
|
||||
from lnbits.core.services import redeem_lnurl_withdraw
|
||||
|
||||
main_app: Optional[QuartTrio] = None
|
||||
|
||||
@@ -93,6 +95,14 @@ async def check_pending_payments():
|
||||
await trio.sleep(60 * 30) # every 30 minutes
|
||||
|
||||
|
||||
async def perform_balance_checks():
|
||||
while True:
|
||||
for bc in await get_balance_checks():
|
||||
redeem_lnurl_withdraw(bc.wallet, bc.url)
|
||||
|
||||
await trio.sleep(60 * 60 * 6) # every 6 hours
|
||||
|
||||
|
||||
async def invoice_callback_dispatcher(checking_id: str):
|
||||
payment = await get_standalone_payment(checking_id)
|
||||
if payment and payment.is_in:
|
||||
|
||||
Reference in New Issue
Block a user