Skip to content

Commit

Permalink
core/statedb: always clear out access list when setting a new one (et…
Browse files Browse the repository at this point in the history
  • Loading branch information
gzliudan committed Aug 23, 2024
1 parent c827337 commit be1b7c4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/state/statedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,6 @@ func (self *StateDB) Prepare(thash, bhash common.Hash, ti int) {
self.thash = thash
self.bhash = bhash
self.txIndex = ti
self.accessList = newAccessList()
}

// DeleteSuicides flags the suicided objects for deletion so that it
Expand Down Expand Up @@ -740,6 +739,9 @@ func (s *StateDB) Commit(deleteEmptyObjects bool) (root common.Hash, err error)
//
// This method should only be called if Yolov3/Berlin/2929+2930 is applicable at the current number.
func (s *StateDB) PrepareAccessList(sender common.Address, dst *common.Address, precompiles []common.Address, list types.AccessList) {
// Clear out any leftover from previous executions
s.accessList = newAccessList()

s.AddAddressToAccessList(sender)
if dst != nil {
s.AddAddressToAccessList(*dst)
Expand Down

0 comments on commit be1b7c4

Please sign in to comment.