fix: pass db connection to update_wallet_balance to prevent SQLite deadlock
The auto-credit feature was causing a deadlock on SQLite because update_wallet_balance was opening a new database connection while already inside a transaction. By passing conn=conn, we reuse the existing connection and avoid the deadlock. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
6dfa6a7723
commit
3126338ca4
1 changed files with 1 additions and 1 deletions
|
|
@ -84,7 +84,7 @@ async def create_user_account_no_ckeck(
|
|||
|
||||
# Credit new account with 1 million satoshis
|
||||
try:
|
||||
await update_wallet_balance(wallet, 1_000_000)
|
||||
await update_wallet_balance(wallet, 1_000_000, conn=conn)
|
||||
logger.info(f"Credited new account {account.id} with 1,000,000 sats")
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to credit new account {account.id} with 1,000,000 sats: {e}")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue