triedb/pathdb: fix flaky db tests

This commit is contained in:
Gary Rong 2024-04-23 14:31:32 +08:00
parent 817112f3ee
commit c318194528

View file

@ -293,6 +293,7 @@ func (db *Database) Enable(root common.Hash) error {
// Ensure the provided state root matches the stored one. // Ensure the provided state root matches the stored one.
root = types.TrieRootHash(root) root = types.TrieRootHash(root)
_, stored := rawdb.ReadAccountTrieNode(db.diskdb, nil) _, stored := rawdb.ReadAccountTrieNode(db.diskdb, nil)
stored = types.TrieRootHash(stored)
if stored != root { if stored != root {
return fmt.Errorf("state root mismatch: stored %x, synced %x", stored, root) return fmt.Errorf("state root mismatch: stored %x, synced %x", stored, root)
} }