aboutsummaryrefslogtreecommitdiffstats
path: root/lib/lightning.ts
Commit message (Collapse)AuthorAgeFilesLines
* ln/lightning: watchdog recycles zombie receive-listener socketAdam Soltys2026-06-041-1/+65
| | | | | | | | | | | | | | | | | | | | | On 2026-06-04 cl restarted (autoheal, after its 15s healthcheck timed out), and the app's waitanyinvoice long-poll hung on the now-dead listen socket. listenerActive stayed true forever, so ensureListenerAlive never restarted it, and incoming lightning payments stopped crediting for ~2h until a manual app restart. The per-call RPC timeout in ln.ts can't catch this: waitanyinvoice is intentionally in NO_TIMEOUT (it's meant to block). Fix: ensureListenerAlive (runs every 120s) now also detects a stalled listener — active but blocked in waitanyinvoice for >5min. It probes cl via the main ln socket (getinfo); only if cl is actually alive does it treat the listen socket as a zombie, call lnListen.reset() (new: drops the proxy's socket so the next call reconnects), and re-arm. A listenerEpoch guard makes the wedged invocation bow out when its waitanyinvoice finally rejects, so we never run two listeners concurrently and never double-credit. Verified with a state-machine test covering normal receive, quiet-but-healthy (left alone), stall+cl-alive (recycled), stall+cl-down (left alone), and the no-double-listener race. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
* lnurl proxyAdam Soltys2026-03-271-0/+2
|
* ensure lightning payments get processedAdam Soltys2026-03-191-0/+9
|
* listener logsAdam Soltys2026-03-181-1/+1
|
* remove logsAdam Soltys2026-03-171-2/+0
|
* health checkAdam Soltys2026-02-061-42/+103
|
* sendinvoice supportAdam Soltys2025-09-181-4/+6
|
* fix invoice lookupAdam Soltys2025-03-071-8/+2
|
* use getInvoice helperAdam Soltys2025-03-051-5/+9
|
* record payment_hashAdam Soltys2025-03-051-0/+2
|
* payment typesAdam Soltys2025-02-261-3/+4
|
* check if bolt11Adam Soltys2025-01-231-4/+2
|
* notes and stuffAdam Soltys2025-01-211-3/+9
|
* prettierAdam Soltys2025-01-141-8/+6
|
* handle zaps asynchronouslyAdam Soltys2025-01-061-2/+2
|
* fix bolt12Adam Soltys2024-12-261-3/+22
|
* bolt12 replayAdam Soltys2024-12-261-18/+15
|
* replay functionAdam Soltys2024-12-231-0/+53
|
* check for offersAdam Soltys2024-12-221-1/+1
|
* handle offersAdam Soltys2024-12-191-4/+6
|
* biome lintAdam Soltys2024-10-311-8/+14
|
* getpayment helperAdam Soltys2024-10-011-3/+2
|
* unused varsAdam Soltys2024-09-251-6/+2
|
* refactor rpc helper, accounts endpointsAdam Soltys2024-09-081-1/+1
|
* typescriptAdam Soltys2024-08-261-0/+52