mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-10 14:17:56 +01:00
This commit addresses a regression where Neutrino rescanning starts from an outdated height (~100k blocks behind) instead of using the current synced height. Root Cause: In commit16a8b623b, the initialization order was changed so that Chain Notifier starts before wallet syncing completes. This means the rescan begins using the stale height from BuildChainControl rather than the fully synced height. Old behavior (commit1dfb5a0c2): 1. RPC server starts 2. Headers sync as part of daemon server 3. Chain Notifier starts after sync completes 4. Rescan begins from current (synced) height Current behavior (regression): 1. Chain Notifier starts in newServer (before RPC) 2. Wallet sync happens after RPC server starts 3. Rescan uses outdated height from BuildChainControl Solution: - Ensure headers are fully synced before starting the chain notifier, and after starting the RPC server. - Move chain notifier startup to its correct location after headers are fully synced. - Make sure the starting beat is lazily called after chain notifier started and before that starting beat result is used.
174 KiB
174 KiB