mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-17 10:20:44 +00:00
core/statedb: always clear out access list when setting a new one (#24515)
This commit is contained in:
parent
588847ccea
commit
d1dc9e383c
1 changed files with 3 additions and 1 deletions
|
|
@ -643,7 +643,6 @@ func (s *StateDB) IntermediateRoot(deleteEmptyObjects bool) common.Hash {
|
||||||
func (s *StateDB) Prepare(thash common.Hash, ti int) {
|
func (s *StateDB) Prepare(thash common.Hash, ti int) {
|
||||||
s.thash = thash
|
s.thash = thash
|
||||||
s.txIndex = ti
|
s.txIndex = ti
|
||||||
s.accessList = newAccessList()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeleteSuicides flags the suicided objects for deletion so that it
|
// DeleteSuicides flags the suicided objects for deletion so that it
|
||||||
|
|
@ -728,6 +727,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.
|
// 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) {
|
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)
|
s.AddAddressToAccessList(sender)
|
||||||
if dst != nil {
|
if dst != nil {
|
||||||
s.AddAddressToAccessList(*dst)
|
s.AddAddressToAccessList(*dst)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue