Skip to content

Commit

Permalink
fix: fix ancient index issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jingjunLi committed Jul 4, 2024
1 parent c5fb788 commit 98c89db
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/rawdb/freezer.go
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ func gcKvStore(db ethdb.KeyValueStore, ancients map[uint64]common.Hash, first ui
"blocks", frozen - first, "elapsed", common.PrettyDuration(time.Since(start)), "number", frozen - 1,
}
if n := len(ancients); n > 0 {
context = append(context, []interface{}{"hash", ancients[uint64(len(ancients)-1)]}...)
context = append(context, []interface{}{"hash", ancients[frozen-1]}...)
}
log.Info("Deep froze chain segment", context...)
}
Expand Down
2 changes: 1 addition & 1 deletion core/rawdb/prunedfreezer.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ func (f *prunedfreezer) freeze() {
break
}
if hash != (common.Hash{}) {
ancients[f.frozen] = hash
ancients[f.frozen-1] = hash
}
}
// Batch of blocks have been frozen, flush them before wiping from leveldb
Expand Down

0 comments on commit 98c89db

Please sign in to comment.