Skip to content

Commit f49bb8e

Browse files
committed
properly clean up speoch states
1 parent d5030b3 commit f49bb8e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

indexer/beacon/epochcache.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ func (cache *epochCache) removeUnreferencedEpochStates() uint64 {
248248
defer cache.cacheMutex.Unlock()
249249

250250
removed := uint64(0)
251-
for _, state := range cache.stateMap {
251+
for root, state := range cache.stateMap {
252252
found := false
253253
for _, stats := range cache.statsMap {
254254
if stats.dependentState == state {
@@ -259,7 +259,7 @@ func (cache *epochCache) removeUnreferencedEpochStates() uint64 {
259259

260260
if !found {
261261
state.dispose()
262-
delete(cache.stateMap, state.slotRoot)
262+
delete(cache.stateMap, root)
263263
removed++
264264
}
265265
}

0 commit comments

Comments
 (0)