fix: proper status check in invoice paid callback (#2592)

status fields like preimage and fee_msat are never updated otherwise
This commit is contained in:
jackstar12 2024-07-22 16:59:26 +02:00 committed by GitHub
parent 7298c4664b
commit f9133760fc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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)