From 2ce5a8ffcd81b5a24eb2c308530d5b83ab70d9ee Mon Sep 17 00:00:00 2001 From: Patrick Mulligan Date: Sun, 1 Mar 2026 17:12:20 -0500 Subject: [PATCH] fix(lnd): wait for chain/graph sync before marking LND ready Warmup() previously only checked that LND responded to GetInfo(), but did not verify syncedToChain/syncedToGraph. This caused LP to accept requests while LND was still syncing, leading to "not synced" errors on every Health() check. Now waits for full sync with a 10min timeout. Co-Authored-By: Claude Opus 4.6 --- src/services/lnd/lnd.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/services/lnd/lnd.ts b/src/services/lnd/lnd.ts index fb3815dd..ce19eae5 100644 --- a/src/services/lnd/lnd.ts +++ b/src/services/lnd/lnd.ts @@ -142,15 +142,20 @@ export default class { return new Promise((res, rej) => { const interval = setInterval(async () => { try { - await this.GetInfo() + const info = await this.GetInfo() + if (!info.syncedToChain || !info.syncedToGraph) { + this.log("LND responding but not synced yet, waiting...") + return + } clearInterval(interval) this.ready = true res() } catch (err) { this.log(INFO, "LND is not ready yet, will try again in 1 second") - if (Date.now() - now > 1000 * 60) { - rej(new Error("LND not ready after 1 minute")) - } + } + if (Date.now() - now > 1000 * 60 * 10) { + clearInterval(interval) + rej(new Error("LND not synced after 10 minutes")) } }, 1000) })