From f9133760fce1ab96cf593a205f39e06b8818a8b2 Mon Sep 17 00:00:00 2001 From: jackstar12 <62219658+jackstar12@users.noreply.github.com> Date: Mon, 22 Jul 2024 16:59:26 +0200 Subject: [PATCH] fix: proper status check in invoice paid callback (#2592) status fields like preimage and fee_msat are never updated otherwise --- lnbits/tasks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lnbits/tasks.py b/lnbits/tasks.py index 15860b260..27538a6f9 100644 --- a/lnbits/tasks.py +++ b/lnbits/tasks.py @@ -175,7 +175,7 @@ async def check_pending_payments(): async def invoice_callback_dispatcher(checking_id: str): """ - Takes incoming payments, sets pending=False, and dispatches them to + Takes an incoming payment, checks its status, and dispatches it to invoice_listeners from core and extensions. """ payment = await get_standalone_payment(checking_id, incoming=True) @@ -183,7 +183,7 @@ async def invoice_callback_dispatcher(checking_id: str): logger.trace( f"invoice listeners: sending invoice callback for payment {checking_id}" ) - await payment.set_pending(False) + await payment.check_status() for name, send_chan in invoice_listeners.items(): logger.trace(f"invoice listeners: sending to `{name}`") await send_chan.put(payment)