Commit graph

5 commits

Author SHA1 Message Date
fusion44
a921686b4a
fix(lightning): clear error for undecodable/wrong-network invoices
Decoding a malformed or wrong-network invoice (e.g. a regtest lnbcrt...
invoice on a mainnet node) made each backend fail with a cryptic,
leaked error: LND with the Go 'strconv.ParseUint: parsing "rt500":
invalid syntax' surfaced as a 500, and CLN with 'Invalid bolt11: ...'.

Add a shared helper raise_for_pay_req_decode_error() in lightning/utils
that recognizes the decode-failure signatures of both backends and
raises one clear 400 pointing at the likely cause (malformed or wrong
network). Wire LND (lnd_grpc), CLN gRPC and CLN JSON-RPC through it so
they behave identically; genuine backend errors still return 500.

Fixes #225

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-12 18:41:18 +02:00
fusion44
adf472ac8b feat: implement Ruff as a linter; fix given errors 2023-06-25 07:17:00 +02:00
fusion44
e290de8933
feat: proper error handling resolving peer aliases
Implementations sometimes don't find aliases in the gossip, even if
they are openeing a channel to the pubkey. In this case an empty
string will be returned and the problem logged in debug mode.

refs #199
2023-05-01 20:48:10 +02:00
fusion44
94179cc5da
feat: add CLN JSON-RPC implementation 2023-03-26 20:53:50 +02:00
fusion44
1388205ff5
feat: use CLN bookeeper plugin to serve onchain tx
closes #87, refs #99
2022-11-05 22:35:01 +01:00