mirror of
https://github.com/fusion44/blitz_api.git
synced 2026-08-13 11:52:45 +02:00
Fixes #129, #128, and addresses part of raspiblitz/raspiblitz#3182 BOLT12 offers, keysend payments, and certain CLN invoice types don't always include all fields that the API expects, causing KeyError exceptions that crash the web interface. Changes: - Modified Invoice.from_cln_json() to use .get() with safe defaults for all potentially missing fields (bolt11, amount_msat, payment_hash, description, label, status, etc.) - Added fallback logic for amount_msat to use amount_received_msat when the primary field is missing - Enhanced InvoiceState.from_cln_json() to handle unknown/missing statuses gracefully with logging instead of raising exceptions This allows the web interface to display all CLN invoices including BOLT12 payments from services like OCEAN mining pool, while preserving all existing payment data for standard BOLT11 invoices. Tested on RaspiBlitz v1.12.0 with Core Lightning and OCEAN mining pool BOLT12 payouts. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| api | ||
| apps | ||
| auth | ||
| bitcoind | ||
| external | ||
| lightning | ||
| setup | ||
| system | ||
| __init__.py | ||
| celery_app.py | ||
| logging.py | ||
| main.py | ||
| server.py | ||