blitz_api/app
fusion44 3980ce0c6b
fix(bitcoind): handle JSON-RPC errors returned with HTTP 200
Bitcoin Core returns the -28 warmup error ('Loading block index',
'Verifying blocks', 'Starting network threads') as an HTTP 200 response
with a JSON-RPC error body. _process_response only classified errors on
the non-200 path and passed a 200 body through unchanged, so the result
had an 'error' key but no 'status' key. Callers doing
'raise HTTPException(result["status"], ...)' then crashed with
KeyError: 'status' instead of HTTPException(425), so the startup
warmup-retry loop in initialize_bitcoin_repo never engaged and the API
(and login) failed while bitcoind was still warming up.

Same root cause, different -28 warmup message.

Fixes #287
Fixes #285

Normalize any JSON-RPC error to an {error, status} dict regardless of the
HTTP status, mapping the warmup messages to 425 TOO_EARLY as before.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-08 13:30:04 +02:00
..
api fix(api): release Redis connections in channel listeners/notifiers 2026-07-03 22:40:14 +02:00
apps fix(apps): report electrs installed/configured/online in advanced status 2026-07-08 13:07:52 +02:00
auth fix(api): replace deprecated asyncio.get_event_loop() 2026-07-03 22:34:44 +02:00
bitcoind fix(bitcoind): handle JSON-RPC errors returned with HTTP 200 2026-07-08 13:30:04 +02:00
external feat: update Python and Devenv deps 2026-02-03 11:04:41 +01:00
lightning fix(api): replace deprecated asyncio.get_event_loop() 2026-07-03 22:34:44 +02:00
setup feat: replace call_script func with better func 2025-05-06 09:16:46 +02:00
system fix(api): replace deprecated asyncio.get_event_loop() 2026-07-03 22:34:44 +02:00
__init__.py feat: prepare for release 0.5.1beta 2023-02-05 21:24:31 +01:00
celery_app.py feat: fetch app status via a celery task 2025-05-06 09:16:46 +02:00
logging.py feat: make config loading more flexible 2025-03-23 17:43:39 +01:00
main.py fix(api): replace deprecated asyncio.get_event_loop() 2026-07-03 22:34:44 +02:00
server.py chore(nix): migrate flake from poetry2nix to uv2nix 2026-07-03 16:00:42 +02:00