From ace8cf960c0697981a133b9d7b1822bf20ac861c Mon Sep 17 00:00:00 2001 From: Shroominic Date: Fri, 30 Jan 2026 10:05:37 +0800 Subject: [PATCH] prevent payout race condition --- routstr/wallet.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/routstr/wallet.py b/routstr/wallet.py index ce87b560..71ea18ac 100644 --- a/routstr/wallet.py +++ b/routstr/wallet.py @@ -319,6 +319,7 @@ async def periodic_payout() -> None: wallet, mint_url, unit, not_reserved=True ) proofs = await slow_filter_spend_proofs(proofs, wallet) + await asyncio.sleep(5) user_balance = await db.balances_for_mint_and_unit( session, mint_url, unit ) @@ -344,8 +345,6 @@ async def periodic_payout() -> None: "amount_received": amount_received, }, ) - - await asyncio.sleep(5) except Exception as e: logger.error( f"Error sending payout: {type(e).__name__}",