Skip to content

Commit 052f558

Browse files
cygaarRoberto Bayardo
authored and
Roberto Bayardo
committed
core/state: logic equivalence for GetCodeHash (ethereum#28733)
1 parent 9da84a7 commit 052f558

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

core/state/statedb.go

Lines changed: 3 additions & 3 deletions
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)