diff options
author | Sheldon <11510383@mail.sustc.edu.cn> | 2019-03-12 17:14:24 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2019-03-12 17:14:24 +0800 |
commit | da5de012c35c677e2e7a43373951ba18b6749e9b (patch) | |
tree | 61a928813ed9243c480bf232f38e606f08980476 /core | |
parent | 04a4a23c2d99d758517139f5f78f2c83ef0bcc41 (diff) | |
download | go-tangerine-da5de012c35c677e2e7a43373951ba18b6749e9b.tar go-tangerine-da5de012c35c677e2e7a43373951ba18b6749e9b.tar.gz go-tangerine-da5de012c35c677e2e7a43373951ba18b6749e9b.tar.bz2 go-tangerine-da5de012c35c677e2e7a43373951ba18b6749e9b.tar.lz go-tangerine-da5de012c35c677e2e7a43373951ba18b6749e9b.tar.xz go-tangerine-da5de012c35c677e2e7a43373951ba18b6749e9b.tar.zst go-tangerine-da5de012c35c677e2e7a43373951ba18b6749e9b.zip |
state: fix emptyStatet to emptyRoot (#19254)
Diffstat (limited to 'core')
-rw-r--r-- | core/state/statedb.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/state/statedb.go b/core/state/statedb.go index 8ad25a582..3fc1d3271 100644 --- a/core/state/statedb.go +++ b/core/state/statedb.go @@ -37,8 +37,8 @@ type revision struct { } var ( - // emptyState is the known hash of an empty state trie entry. - emptyState = crypto.Keccak256Hash(nil) + // emptyRoot is the known root hash of an empty trie. + emptyRoot = common.HexToHash("56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421") // emptyCode is the known hash of the empty EVM bytecode. emptyCode = crypto.Keccak256Hash(nil) @@ -653,7 +653,7 @@ func (s *StateDB) Commit(deleteEmptyObjects bool) (root common.Hash, err error) if err := rlp.DecodeBytes(leaf, &account); err != nil { return nil } - if account.Root != emptyState { + if account.Root != emptyRoot { s.db.TrieDB().Reference(account.Root, parent) } code := common.BytesToHash(account.CodeHash) |