clarify case about selfdestructing initcode

This commit is contained in:
Jared Wasinger 2025-10-14 12:08:19 +08:00
parent 58eac317b1
commit 77a98936ed

View file

@ -315,9 +315,7 @@ func (s *hookedStateDB) Finalise(deleteEmptyObjects bool) {
prevCodeHash := s.inner.GetCodeHash(addr)
prevCode := s.inner.GetCode(addr)
// don't record a code change if its a selfdestructing initcode
// ^ TODO: I assume that this is the only case where this can occur but should double-check
// just to be totally sure
// if an initcode invokes selfdestruct, do not emit a code change.
if prevCodeHash == types.EmptyCodeHash {
continue
}