mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 13:46:43 +00:00
triedb: skip if frozen is empty
Signed-off-by: jsvisa <delweng@gmail.com>
This commit is contained in:
parent
9412ec62d0
commit
fe6c3f69dc
1 changed files with 13 additions and 0 deletions
|
|
@ -511,6 +511,19 @@ func (i *indexIniter) index(done chan struct{}, interrupt *atomic.Int32, lastID
|
|||
}
|
||||
return
|
||||
}
|
||||
// If the freezer is empty, no state history has been written.
|
||||
// This can happen when the freezer was corrupted/lost
|
||||
frozen, err := i.freezer.Ancients()
|
||||
if err != nil {
|
||||
log.Error("Failed to retrieve head of state history", "err", err)
|
||||
return
|
||||
}
|
||||
if frozen == 0 {
|
||||
storeIndexMetadata(i.disk, lastID)
|
||||
log.Info("No state history to index, skipping", "beginID", beginID, "lastID", lastID)
|
||||
return
|
||||
}
|
||||
|
||||
log.Info("Start history indexing", "beginID", beginID, "lastID", lastID)
|
||||
|
||||
var (
|
||||
|
|
|
|||
Loading…
Reference in a new issue