Skip to content

Commit da5de01

Browse files
Sheldonkaralabe
authored andcommitted
state: fix emptyStatet to emptyRoot (#19254)
1 parent 04a4a23 commit da5de01

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎core/state/statedb.go‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ type revision struct {
3737
}
3838

3939
var (
40-
// emptyState is the known hash of an empty state trie entry.
41-
emptyState = crypto.Keccak256Hash(nil)
40+
// emptyRoot is the known root hash of an empty trie.
41+
emptyRoot = common.HexToHash("56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421")
4242

4343
// emptyCode is the known hash of the empty EVM bytecode.
4444
emptyCode = crypto.Keccak256Hash(nil)
@@ -653,7 +653,7 @@ func (s *StateDB) Commit(deleteEmptyObjects bool) (root common.Hash, err error)
653653
if err := rlp.DecodeBytes(leaf, &account); err != nil {
654654
return nil
655655
}
656-
if account.Root != emptyState {
656+
if account.Root != emptyRoot {
657657
s.db.TrieDB().Reference(account.Root, parent)
658658
}
659659
code := common.BytesToHash(account.CodeHash)

0 commit comments

Comments
 (0)