mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 13:46:43 +00:00
triedb/pathdb: reset index metadata when state pruned
Signed-off-by: jsvisa <delweng@gmail.com>
This commit is contained in:
parent
9570480b4d
commit
1a340075ef
1 changed files with 6 additions and 0 deletions
|
|
@ -337,6 +337,12 @@ func (db *Database) repairHistory() error {
|
||||||
}
|
}
|
||||||
if pruned != 0 {
|
if pruned != 0 {
|
||||||
log.Warn("Truncated extra state histories", "number", pruned)
|
log.Warn("Truncated extra state histories", "number", pruned)
|
||||||
|
oldID := uint64(0)
|
||||||
|
if meta := loadIndexMetadata(db.diskdb); meta != nil {
|
||||||
|
oldID = meta.Last
|
||||||
|
}
|
||||||
|
log.Warn("Reset state history index metadata after truncation", "oldID", oldID, "newID", id)
|
||||||
|
storeIndexMetadata(db.diskdb, id)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue