triedb/pathdb: fix

This commit is contained in:
Gary Rong 2024-04-26 16:02:24 +08:00
parent d28b39e698
commit d5aefb1897

View file

@ -309,7 +309,7 @@ func (db *Database) Enable(root common.Hash) error {
root = types.TrieRootHash(root)
stored := types.EmptyRootHash
if blob := rawdb.ReadAccountTrieNode(db.diskdb, nil); len(blob) > 0 {
stored = crypto.Keccak256Hash()
stored = crypto.Keccak256Hash(blob)
}
if stored != root {
return fmt.Errorf("state root mismatch: stored %x, synced %x", stored, root)