Skip to content

Commit

Permalink
Prune any orphaned blocks included in prune window during load
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Dudley <[email protected]>
  • Loading branch information
siladu committed Oct 26, 2023
1 parent d921ad4 commit d19a691
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ void preloadCache() {
if (header.isPresent()) {
knownTrieLogKeysByDescendingBlockNumber.put(header.get().getNumber(), hashAsBytes);
count.getAndIncrement();
} else {
// prune orphaned blocks (sometimes created during block production)
rootWorldStateStorage.pruneTrieLog(hashAsBytes);
}
});
LOG.atInfo().log("Loaded {} trie logs from database", count);
Expand Down

0 comments on commit d19a691

Please sign in to comment.