diff options
| author | Adam Soltys <[email protected]> | 2026-08-15 23:16:28 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-08-15 23:16:28 -0700 |
| commit | 7c6805decc508b009673e1a5651b2a86ebdef717 (patch) | |
| tree | 79277026c361ba94694d88a7acfd69ae31f4d36a /lib/sockets.ts | |
| parent | 14948460559788db024ff99406dd18adaed206ba (diff) | |
| download | coinos-server-7c6805decc508b009673e1a5651b2a86ebdef717.tar.gz coinos-server-7c6805decc508b009673e1a5651b2a86ebdef717.zip | |
ln: tear down dead cl clients fully + recover invoice listener on socket death
Replace bare `client = null` with dropClient(): stop the clightning-client
library's internal reconnect loop (clear reconnectTimeout, neuter reconnect,
destroy the socket, drop listeners). A dead client was otherwise orphaned and
spun forever retrying `connect ENOENT`, spamming logs and leaking a socket+timer
on every cl restart. Guard the error handler on `c === client` so a stale
client's late error can't drop a newer, healthy one.
Add lnListen.onDrop so the invoice listener recycles immediately when its
long-poll socket dies (bump epoch, re-arm) instead of waiting up to 5 minutes for
the stall watchdog. Stop counting LightningUnavailableError toward the listener's
process.exit escalation, so a cl restart no longer makes the app self-exit — it
retries until cl returns.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Diffstat (limited to 'lib/sockets.ts')
0 files changed, 0 insertions, 0 deletions
