Commit da5de012 authored by Sheldon's avatar Sheldon Committed by Péter Szilágyi

state: fix emptyStatet to emptyRoot (#19254)

parent 04a4a23c
...@@ -37,8 +37,8 @@ type revision struct { ...@@ -37,8 +37,8 @@ type revision struct {
} }
var ( var (
// emptyState is the known hash of an empty state trie entry. // emptyRoot is the known root hash of an empty trie.
emptyState = crypto.Keccak256Hash(nil) emptyRoot = common.HexToHash("56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421")
// emptyCode is the known hash of the empty EVM bytecode. // emptyCode is the known hash of the empty EVM bytecode.
emptyCode = crypto.Keccak256Hash(nil) emptyCode = crypto.Keccak256Hash(nil)
...@@ -653,7 +653,7 @@ func (s *StateDB) Commit(deleteEmptyObjects bool) (root common.Hash, err error) ...@@ -653,7 +653,7 @@ func (s *StateDB) Commit(deleteEmptyObjects bool) (root common.Hash, err error)
if err := rlp.DecodeBytes(leaf, &account); err != nil { if err := rlp.DecodeBytes(leaf, &account); err != nil {
return nil return nil
} }
if account.Root != emptyState { if account.Root != emptyRoot {
s.db.TrieDB().Reference(account.Root, parent) s.db.TrieDB().Reference(account.Root, parent)
} }
code := common.BytesToHash(account.CodeHash) code := common.BytesToHash(account.CodeHash)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment