From 658724acea184ba4f15ddc70fe9f1cf8946ff51d Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sat, 22 Aug 2026 08:08:13 -0700 Subject: ln: bound receive-listener wait, phase-aware watchdog, re-enable health check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Give waitanyinvoice an explicit 30s server-side timeout so a dead/half-open socket can no longer hold the listener indefinitely; CLN's 904 timeout during a quiet period is treated as a clean re-arm without counting as a failure. Split the listener into waiting vs processing phases so the watchdog never resets a healthy socket merely because a ledger write is slow, and never starts a second concurrent processor — a stalled processing phase is surfaced loudly instead. Process the settlement and confirm the durable payment pointer BEFORE advancing pay_index, so a store load/restart between the cursor write and credit() cannot drop a received payment. Expose listener status and add a backlog probe to the health check, and re-enable startHealthCheck(). Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01XiwgmQKwKnRxUmVDd4xSf7 --- index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'index.ts') diff --git a/index.ts b/index.ts index f607ecb8..328c453f 100644 --- a/index.ts +++ b/index.ts @@ -30,7 +30,7 @@ try { catchUp(); nwc(); check(); - // startHealthCheck(); + startHealthCheck(); } catch (e) {} setTimeout(listenForLightning, 2000); -- cgit v1.2.3