Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions app/lightning/impl/cln_jrpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,8 +415,14 @@ async def list_payments(
continue

if include_incomplete:
b11_decoded = await self._decode_bolt11_cached(p["bolt11"])
p["amount_msat"] = b11_decoded.num_msat
# bolt11 is absent for keysend and BOLT12 payments — only
# decode it when present and amount_msat isn't already set.
bolt11 = p.get("bolt11")
if bolt11 and "amount_msat" not in p:
b11_decoded = await self._decode_bolt11_cached(bolt11)
p["amount_msat"] = b11_decoded.num_msat
elif "amount_msat" not in p:
p["amount_msat"] = p.get("amount_sent_msat", 0)
pays.append(Payment.from_cln_jrpc(p))

if reversed:
Expand Down
26 changes: 23 additions & 3 deletions app/lightning/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@
if ln_node != "none":
ln = LnNode()

if ln_node != "none":
ln = LnNode()


async def initialize_ln_repo() -> AsyncGenerator[InitLnRepoUpdate, None]:
async for u in ln.initialize():
Expand Down Expand Up @@ -169,6 +166,29 @@ async def channel_close(channel_id: int, force_close: bool) -> str:


async def get_ln_info() -> LnInfo:
# Bitcoin-only mode (`BAPI_LN_NODE=none`) leaves the module-level
# `ln` global unbound — every `await ln.X()` in this file would
# NameError. The most-hit caller in bitcoin-only mode is
# `NativePythonSystem.get_system_info()`, which always reads
# `lninfo.alias` and `lninfo.color` to populate `SystemInfo`.
# That call breaks the SSE warmup pipeline (`get_full_client_warmup_data_bitcoinonly`)
# so new SSE subscribers never receive `btc_info`. Return a stub
# so the bitcoin-only happy path keeps working.
if ln_node == "none":
return LnInfo(
implementation="none",
version="",
commit_hash="",
identity_pubkey="",
identity_uri="",
alias="",
color="#000000",
num_pending_channels=0,
num_active_channels=0,
num_inactive_channels=0,
num_peers=0,
block_height=0,
)
ln_info = await ln.get_ln_info()
if PLATFORM == APIPlatform.RASPIBLITZ:
ln_info.identity_uri = await redis_get("ln_default_address")
Expand Down
134 changes: 45 additions & 89 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading