<feed xmlns='http://www.w3.org/2005/Atom'>
<title>coinos-server.git/lib/ln.ts, branch staging</title>
<subtitle>coinos server — legacy coinos.io backend (Lightning, on-chain, Liquid)</subtitle>
<id>https://git.coinos.io/coinos-server.git/atom?h=staging</id>
<link rel='self' href='https://git.coinos.io/coinos-server.git/atom?h=staging'/>
<link rel='alternate' type='text/html' href='https://git.coinos.io/coinos-server.git/'/>
<updated>2026-06-17T14:47:50Z</updated>
<entry>
<title>ln: time out short-lived RPCs so a hung cl reconnects without restart</title>
<updated>2026-06-17T14:47:50Z</updated>
<author>
<name>Adam Soltys</name>
<email>adam@coinos.io</email>
</author>
<published>2026-06-14T19:44:19Z</published>
<link rel='alternate' type='text/html' href='https://git.coinos.io/coinos-server.git/commit/?id=3d2a980971b59cdd2a4ea41b2da51f370eee6b75'/>
<id>urn:sha1:3d2a980971b59cdd2a4ea41b2da51f370eee6b75</id>
<content type='text'>
Port of master a664af99. A unix-domain RPC socket has no TCP keepalive, so
if cl goes unresponsive while the socket stays open (zombie/half-open) an
awaited call hangs forever — nothing throws, the reconnect-on-error path
never fires, and only an app restart recovers. Wrap short-lived calls in a
30s Promise.race timeout (matching lib/health.ts); a timeout rejects with
ETIMEDOUT, now part of isSocketDied, so the client is dropped and the next
call reconnects. Long-polls, in-flight payments (pay/xpay/sendpay/keysend)
and bolt12 round-trips are exempt to avoid leaked debits.

Co-Authored-By: Claude Opus 4.8 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>ln/lightning: watchdog recycles zombie receive-listener socket</title>
<updated>2026-06-08T22:49:26Z</updated>
<author>
<name>Adam Soltys</name>
<email>asoltys@gmail.com</email>
</author>
<published>2026-06-08T22:49:26Z</published>
<link rel='alternate' type='text/html' href='https://git.coinos.io/coinos-server.git/commit/?id=7c34b4312c8aafc7643a5192d54daea14cfc1559'/>
<id>urn:sha1:7c34b4312c8aafc7643a5192d54daea14cfc1559</id>
<content type='text'>
Port of master bd1ece3 to staging. When cl restarts (e.g. autoheal after a
healthcheck timeout), the app's waitanyinvoice long-poll can hang on the now-dead
listen socket: listenerActive stays true forever, nothing restarts it, and
incoming lightning payments silently stop crediting until a manual app restart.
The per-call RPC timeout can't catch this — waitanyinvoice is meant to block.

ensureListenerAlive (run every 120s) now also detects a stalled listener — active
but blocked in waitanyinvoice for &gt;5min — probes cl via the main socket (getinfo),
and only if cl is actually alive treats the listen socket as a zombie: bumps a
listenerEpoch, calls lnListen.reset() (new: drops the proxy socket so the next
call reconnects), and re-arms. The epoch guard makes the wedged invocation bow out
when its waitanyinvoice finally rejects, so we never run two listeners or
double-credit.

Co-Authored-By: Claude Opus 4.8 (1M context) &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>handle socket-level errors that bypass Bun's JS error path</title>
<updated>2026-05-18T06:50:53Z</updated>
<author>
<name>Adam Soltys</name>
<email>adam@coinos.io</email>
</author>
<published>2026-05-18T06:50:53Z</published>
<link rel='alternate' type='text/html' href='https://git.coinos.io/coinos-server.git/commit/?id=c0f087a9102ef325eab146832055da7ec2ee3220'/>
<id>urn:sha1:c0f087a9102ef325eab146832055da7ec2ee3220</id>
<content type='text'>
Two related defenses around the CLN unix socket connection:

- Global net.Socket.prototype.connect patch: when Bun's
  net.createConnection is called on a non-existent unix socket, the
  ENOENT it throws bypasses all JS error handlers and crashes the
  process. existsSync-check the path first; if missing, emit a normal
  'error' event so the caller can handle it gracefully.

- lightningProxy: existsSync gate before constructing LightningClient,
  plus a client.on("error") listener that clears the cached client on
  socket-died errors instead of letting the unhandled event take down
  the process.

Co-Authored-By: Claude Opus 4.7 (1M context) &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>conditional lnb</title>
<updated>2026-03-16T23:37:03Z</updated>
<author>
<name>Adam Soltys</name>
<email>adam@coinos.io</email>
</author>
<published>2026-03-16T04:25:24Z</published>
<link rel='alternate' type='text/html' href='https://git.coinos.io/coinos-server.git/commit/?id=4a3d3b676ec7c21077786c7cdd33772385b87a6d'/>
<id>urn:sha1:4a3d3b676ec7c21077786c7cdd33772385b87a6d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>fix typescript issues</title>
<updated>2026-02-28T23:16:20Z</updated>
<author>
<name>Adam Soltys</name>
<email>adam@coinos.io</email>
</author>
<published>2026-02-28T23:16:20Z</published>
<link rel='alternate' type='text/html' href='https://git.coinos.io/coinos-server.git/commit/?id=32f01e3e328db0006a55c6324625b49d60244b66'/>
<id>urn:sha1:32f01e3e328db0006a55c6324625b49d60244b66</id>
<content type='text'>
</content>
</entry>
<entry>
<title>formatting</title>
<updated>2026-02-24T21:18:42Z</updated>
<author>
<name>Adam Soltys</name>
<email>adam@coinos.io</email>
</author>
<published>2026-02-24T21:18:42Z</published>
<link rel='alternate' type='text/html' href='https://git.coinos.io/coinos-server.git/commit/?id=ad7b09b43323d0ffc0a8ddabb43e4838a184c697'/>
<id>urn:sha1:ad7b09b43323d0ffc0a8ddabb43e4838a184c697</id>
<content type='text'>
</content>
</entry>
<entry>
<title>health check</title>
<updated>2026-02-06T16:55:45Z</updated>
<author>
<name>Adam Soltys</name>
<email>asoltys@gmail.com</email>
</author>
<published>2026-02-06T16:55:45Z</published>
<link rel='alternate' type='text/html' href='https://git.coinos.io/coinos-server.git/commit/?id=9089698e8df9d0c09c165c45eb6b05335a818699'/>
<id>urn:sha1:9089698e8df9d0c09c165c45eb6b05335a818699</id>
<content type='text'>
</content>
</entry>
<entry>
<title>more robust lightning client</title>
<updated>2025-12-16T21:42:42Z</updated>
<author>
<name>Adam Soltys</name>
<email>adam@coinos.io</email>
</author>
<published>2025-12-16T21:42:42Z</published>
<link rel='alternate' type='text/html' href='https://git.coinos.io/coinos-server.git/commit/?id=52fb26dbaf6a169cc63c50d480d3e7a9a999854c'/>
<id>urn:sha1:52fb26dbaf6a169cc63c50d480d3e7a9a999854c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>xpay</title>
<updated>2024-11-27T08:16:18Z</updated>
<author>
<name>Adam Soltys</name>
<email>adam@coinos.io</email>
</author>
<published>2024-11-27T08:16:18Z</published>
<link rel='alternate' type='text/html' href='https://git.coinos.io/coinos-server.git/commit/?id=430b17d26fa3fe2ef31c6fb0850882a9fd4c830c'/>
<id>urn:sha1:430b17d26fa3fe2ef31c6fb0850882a9fd4c830c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>save ecash id</title>
<updated>2024-10-24T20:59:34Z</updated>
<author>
<name>Adam Soltys</name>
<email>asoltys@gmail.com</email>
</author>
<published>2024-10-24T20:59:34Z</published>
<link rel='alternate' type='text/html' href='https://git.coinos.io/coinos-server.git/commit/?id=d09712ef8f8ea8218ce229b233fc0013e6c06f7a'/>
<id>urn:sha1:d09712ef8f8ea8218ce229b233fc0013e6c06f7a</id>
<content type='text'>
</content>
</entry>
</feed>
