From c277e8baadcd22b8846cdbd3b9a9b9a4756c13f5 Mon Sep 17 00:00:00 2001 From: Larry Ruane Date: Mon, 6 May 2024 08:22:00 -0600 Subject: [PATCH] Reduce lightwalletd startup (if disk cache already exists) Reduce the startup time from a couple of minutes to a few seconds (or less) by removing the deserialization of all compact blocks in the disk cache. This is an alternative to PR 482, see comment there for details. --- common/cache.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/common/cache.go b/common/cache.go index 74c56fb9..a16c0935 100644 --- a/common/cache.go +++ b/common/cache.go @@ -243,13 +243,6 @@ func NewBlockCache(dbPath string, chainName string, startHeight int, syncFromHei } offset += int64(length) + 8 c.starts = append(c.starts, offset) - // Check for corruption. - block := c.readBlock(c.nextBlock) - if block == nil { - Log.Warning("error reading block") - c.recoverFromCorruption(c.nextBlock) - break - } c.nextBlock++ } c.setDbFiles(c.nextBlock)