Skip to content

Commit

Permalink
fix: ut error
Browse files Browse the repository at this point in the history
  • Loading branch information
joeylichang committed Nov 3, 2023
1 parent 01c54c9 commit d98c839
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,10 @@ func NewBlockChain(db ethdb.Database, cacheConfig *CacheConfig, genesis *Genesis
diskRoot = rawdb.ReadSnapshotRoot(bc.db)
}
if bc.triedb.Scheme() == rawdb.PathScheme {
diskRoot = bc.triedb.Head()
recoverable, _ := bc.triedb.Recoverable(diskRoot)
if !bc.HasState(diskRoot) && !recoverable {
diskRoot = bc.triedb.Head()
}
}
if diskRoot != (common.Hash{}) {
log.Warn("Head state missing, repairing", "number", head.Number, "hash", head.Hash(), "diskRoot", diskRoot)
Expand Down

0 comments on commit d98c839

Please sign in to comment.