feat: only check the current page (#3015)

This commit is contained in:
Vlad Stan
2025-03-03 16:28:55 +02:00
committed by GitHub
parent 991e0db50b
commit ec77a00f49
2 changed files with 22 additions and 9 deletions
+14 -7
View File
@@ -178,13 +178,20 @@ async def update_pending_payments(wallet_id: str):
exclude_uncheckable=True,
)
for payment in pending_payments:
status = await payment.check_status()
if status.failed:
payment.status = PaymentState.FAILED
await update_payment(payment)
elif status.success:
payment.status = PaymentState.SUCCESS
await update_payment(payment)
await update_pending_payment(payment)
async def update_pending_payment(payment: Payment) -> bool:
status = await payment.check_status()
if status.failed:
payment.status = PaymentState.FAILED
await update_payment(payment)
return True
if status.success:
payment.status = PaymentState.SUCCESS
await update_payment(payment)
return True
return False
def fee_reserve_total(amount_msat: int, internal: bool = False) -> int: