Skip to content

Commit 69422b9

Browse files
authored
Fix stale statistics eviction condition
1 parent c974722 commit 69422b9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

core/state/state_sizer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ func (t *SizeTracker) run() {
346346

347347
// Evict the stale statistics
348348
heap.Push(&h, stats[u.root])
349-
for u.blockNumber-h[0].BlockNumber > statEvictThreshold {
349+
for len(h) > 0 && u.blockNumber-h[0].BlockNumber > statEvictThreshold {
350350
delete(stats, h[0].StateRoot)
351351
heap.Pop(&h)
352352
}

0 commit comments

Comments
 (0)