mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
Revert "core/state: return empty hash root instead of zero"
This reverts commit bf7d3a35c1.
Signed-off-by: jsvisa <delweng@gmail.com>
This commit is contained in:
parent
57125f0566
commit
9e5ebed0d5
1 changed files with 4 additions and 4 deletions
|
|
@ -305,7 +305,7 @@ func (s *StateDB) GetStorageRoot(addr common.Address) common.Hash {
|
||||||
if stateObject != nil {
|
if stateObject != nil {
|
||||||
return stateObject.Root()
|
return stateObject.Root()
|
||||||
}
|
}
|
||||||
return types.EmptyRootHash
|
return common.Hash{}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TxIndex returns the current transaction index set by Prepare.
|
// TxIndex returns the current transaction index set by Prepare.
|
||||||
|
|
@ -331,10 +331,10 @@ func (s *StateDB) GetCodeSize(addr common.Address) int {
|
||||||
|
|
||||||
func (s *StateDB) GetCodeHash(addr common.Address) common.Hash {
|
func (s *StateDB) GetCodeHash(addr common.Address) common.Hash {
|
||||||
stateObject := s.getStateObject(addr)
|
stateObject := s.getStateObject(addr)
|
||||||
if stateObject != nil {
|
if stateObject == nil {
|
||||||
return common.BytesToHash(stateObject.CodeHash())
|
return common.Hash{}
|
||||||
}
|
}
|
||||||
return types.EmptyCodeHash
|
return common.BytesToHash(stateObject.CodeHash())
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetState retrieves a value from the given account's storage trie.
|
// GetState retrieves a value from the given account's storage trie.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue