mirror of
https://github.com/fusion44/blitz_api.git
synced 2026-08-15 12:10:12 +02:00
`ln` is only bound to LnNode() when `BAPI_LN_NODE != "none"`. Every `await ln.X()` call in this file therefore NameErrors when the operator runs in bitcoin-only mode. The most-hit caller is NativePythonSystem.get_system_info() at app/system/impl/native_python.py:32, which always reads `lninfo.alias` and `lninfo.color` to populate SystemInfo. The NameError there breaks the SSE warmup pipeline (get_full_client_warmup_data_bitcoinonly in app/api/warmup.py:116): warmup_new_connections() — calls get_full_client_warmup_data_bitcoinonly() → get_system_info() (via NativePythonSystem) → get_ln_info() → NameError: name 'ln' is not defined The exception bubbles into the asyncio.gather(), which means new SSE subscribers in bitcoin-only mode never receive `btc_info` / `system_info` / `installed_app_status`. Their dashboards stay empty forever (only periodic `hardware_info` and `ping` events flow, because those run on separate gather loops). Two fixes in this commit: 1. Return a stub LnInfo from get_ln_info() when ln_node == "none". All required fields filled with empty strings / zeros; the stub round-trips through any caller that reads alias/color/num_* without error. Other ln-method callers (get_wallet_balance, list_invoices, ...) keep their original behavior — they'll only ever fire from LN-aware code paths anyway. 2. Drop the duplicate `if ln_node != "none": ln = LnNode()` block at lines 69-70 (clearly a merge artifact). Operator workaround used until this lands: enable lnd. After this fix, bitcoin-only mode works end-to-end against the nixblitz plugin streamer. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| api | ||
| apps | ||
| auth | ||
| bitcoind | ||
| external | ||
| lightning | ||
| setup | ||
| system | ||
| __init__.py | ||
| celery_app.py | ||
| logging.py | ||
| main.py | ||
| server.py | ||