AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Informational 20 Bitcoin

pyln-client: don't crash Millisatoshi.to_approx_str() on zero

Public commit record

What the developer wrote

Authored by Amartya Singh

73/100 · Adequate
pyln-client: don't crash Millisatoshi.to_approx_str() on zero

round_to_n() took log10() of the amount to find its magnitude, which
fails for 0. Zero needs no rounding, so return it as is; the shortest
unit then comes out as "0btc", the same way 1 BTC prints as "1btc".

Changelog-Fixed: pyln-client: `Millisatoshi(0).to_approx_str()` no longer raises a ValueError.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit fixes a minor bug in Core Lightning's Python client library where calling a pretty-printing method on a zero-amount payment would crash with a ValueError. It is a routine correctness fix, not a security vulnerability. There is no way to exploit it to steal funds, bypass security, or attack a node.

Recommended action

No security action required. Treat as a normal bug-fix release note for the Python client library.

Security signals we found

No strong security signals were identified.

Risk score

Why this scored 20/100

Our methodology →
Potential impact 2/30
Exploitability 0/25
Stealth signal 1/15
Affected reach 3/15
Confidence 9/10
Evidence quality 5/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.