mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 18:32:23 +00:00
swarm/storage: Batch reset in start of loop plus before coda
This commit is contained in:
parent
c4f3af8e01
commit
1f036e1164
1 changed files with 4 additions and 1 deletions
|
|
@ -615,6 +615,8 @@ func (s *LDBStore) CleanGCIndex() error {
|
|||
var chunkHashes [][]byte
|
||||
var pos []uint8
|
||||
it := s.db.NewIterator()
|
||||
|
||||
batch.Reset()
|
||||
it.Seek(lastIdxKey)
|
||||
|
||||
var i int
|
||||
|
|
@ -672,13 +674,14 @@ func (s *LDBStore) CleanGCIndex() error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
batch.Reset()
|
||||
|
||||
log.Debug("clean gc index pass", "batch", cleanBatchCount, "checked", i, "kept", len(idxs))
|
||||
}
|
||||
|
||||
log.Debug("gc cleanup entries", "ok", okEntryCount, "total", totalEntryCount, "batchlen", batch.Len())
|
||||
|
||||
batch.Reset()
|
||||
|
||||
var entryCount [8]byte
|
||||
binary.BigEndian.PutUint64(entryCount[:], okEntryCount)
|
||||
batch.Put(keyEntryCnt, entryCount[:])
|
||||
|
|
|
|||
Loading…
Reference in a new issue