Skip to content

Commit

Permalink
Make caches respect pruning
Browse files Browse the repository at this point in the history
  • Loading branch information
ValarDragon committed Jun 26, 2024
1 parent e8c88d0 commit c3adc49
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions store/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,13 +365,16 @@ func (bs *BlockStore) PruneBlocks(height int64) (uint64, error) {
if err := batch.Delete(calcBlockCommitKey(h)); err != nil {
return 0, err
}
bs.blockCommitCache.Remove(h)
if err := batch.Delete(calcSeenCommitKey(h)); err != nil {
return 0, err
}
bs.seenCommitCache.Remove(h)
for p := 0; p < int(meta.BlockID.PartSetHeader.Total); p++ {
if err := batch.Delete(calcBlockPartKey(h, p)); err != nil {
return 0, err
}
bs.blockPartCache.Remove(blockPartIndex{h, p})
}
pruned++

Expand Down

0 comments on commit c3adc49

Please sign in to comment.