open_new_round_if_needed now withholds opening the next round until ROUND_COOLDOWN_SECONDS (default 30) have passed since the previous round's closed_at, returning None in that window instead of a Round. Without this, the next round opened within one scheduler tick (~5s) of the previous payout confirming — not enough time for a player to notice the round they were in actually resolved. Callers updated: the scheduler treats None as "nothing to do this tick", and place_bet raises a "try again shortly" BetError instead of crashing on a None round. Not in the original flowchart — a deliberate UX addition on top of it, documented as such in CLAUDE.md. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
22 lines
696 B
Bash
22 lines
696 B
Bash
DATABASE_URL=sqlite+aiosqlite:///./plm_lottery.db
|
|
|
|
ELECTRUM_HOST=santantonio.sytes.net
|
|
ELECTRUM_PORT=50002
|
|
ELECTRUM_USE_SSL=true
|
|
|
|
# Fernet key protecting the master xprv at rest. Generate with:
|
|
# python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"
|
|
XPRV_ENCRYPTION_KEY=
|
|
MASTER_KEY_PATH=./master.xprv.enc
|
|
|
|
# Random secret for JWT session signing. Generate with:
|
|
# python -c "import secrets; print(secrets.token_urlsafe(32))"
|
|
JWT_SECRET=
|
|
|
|
# Bearer token required on the admin endpoints (X-Admin-Token header). Generate with:
|
|
# python -c "import secrets; print(secrets.token_urlsafe(32))"
|
|
ADMIN_TOKEN=
|
|
|
|
ROUND_DURATION_SECONDS=600
|
|
ROUND_COOLDOWN_SECONDS=30
|