fix: Ensure Exist method returns true for self-destructed accounts

This commit is contained in:
crypto18mo 2025-01-16 20:50:08 -08:00 committed by GitHub
parent a7f9523ae1
commit 8bf7433d58
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -294,7 +294,7 @@ func (s *StateDB) SubRefund(gas uint64) {
// Exist reports whether the given account address exists in the state.
// Notably this also returns true for self-destructed accounts.
func (s *StateDB) Exist(addr common.Address) bool {
return s.getStateObject(addr) != nil
return s.getStateObject(addr) != nil || s.stateObjectsDestruct[addr] != nil
}
// Empty returns whether the state object is either non-existent