Skip to content

Commit

Permalink
Reduce lightwalletd startup (if disk cache already exists)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Larry Ruane authored and LarryRuane committed Jun 13, 2024
1 parent c6a3fe1 commit 6071b06
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions common/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6071b06

Please sign in to comment.