Skip to content

Commit

Permalink
Merge pull request ethereum#24515 from karalabe/pending-statedb-acces…
Browse files Browse the repository at this point in the history
…slist-init

core/statedb: always clear out access list when setting a new one
  • Loading branch information
karalabe authored and jagdeep sidhu committed Mar 15, 2022
1 parent 9feba54 commit b3b5ad4
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 @@ -884,7 +884,6 @@ func (s *StateDB) IntermediateRoot(deleteEmptyObjects bool) common.Hash {
func (s *StateDB) Prepare(thash common.Hash, ti int) {
s.thash = thash
s.txIndex = ti
s.accessList = newAccessList()
}

func (s *StateDB) clearJournalAndRefund() {
Expand Down Expand Up @@ -994,6 +993,9 @@ func (s *StateDB) Commit(deleteEmptyObjects bool) (common.Hash, error) {
//
// This method should only be called if 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 b3b5ad4

Please sign in to comment.