Skip to content

Commit d2e3cb8

Browse files
authored
core/state: logic equivalence for GetCodeHash (ethereum#28733)
1 parent 8d03918 commit d2e3cb8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

core/state/statedb.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -331,10 +331,10 @@ func (s *StateDB) GetCodeSize(addr common.Address) int {
331331

332332
func (s *StateDB) GetCodeHash(addr common.Address) common.Hash {
333333
stateObject := s.getStateObject(addr)
334-
if stateObject == nil {
335-
return common.Hash{}
334+
if stateObject != nil {
335+
return common.BytesToHash(stateObject.CodeHash())
336336
}
337-
return common.BytesToHash(stateObject.CodeHash())
337+
return common.Hash{}
338338
}
339339

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

0 commit comments

Comments
 (0)