Skip to content

Commit

Permalink
core/state: logic equivalence for GetCodeHash (ethereum#28733)
Browse files Browse the repository at this point in the history
  • Loading branch information
cygaar authored Dec 26, 2023
1 parent 8d03918 commit d2e3cb8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/state/statedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,10 +331,10 @@ func (s *StateDB) GetCodeSize(addr common.Address) int {

func (s *StateDB) GetCodeHash(addr common.Address) common.Hash {
stateObject := s.getStateObject(addr)
if stateObject == nil {
return common.Hash{}
if stateObject != nil {
return common.BytesToHash(stateObject.CodeHash())
}
return common.BytesToHash(stateObject.CodeHash())
return common.Hash{}
}

// GetState retrieves a value from the given account's storage trie.
Expand Down

0 comments on commit d2e3cb8

Please sign in to comment.