core/state: double check the lis availiability before regeneration

This commit is contained in:
Weixie Cui 2026-05-01 23:37:49 +08:00
parent 19dc690af8
commit 484d0ddaae

View file

@ -431,6 +431,10 @@ func (dl *diffLayer) AccountList() []common.Hash {
dl.lock.Lock() dl.lock.Lock()
defer dl.lock.Unlock() defer dl.lock.Unlock()
if list := dl.accountList; list != nil {
return list
}
dl.accountList = slices.SortedFunc(maps.Keys(dl.accountData), common.Hash.Cmp) dl.accountList = slices.SortedFunc(maps.Keys(dl.accountData), common.Hash.Cmp)
dl.memory += uint64(len(dl.accountList) * common.HashLength) dl.memory += uint64(len(dl.accountList) * common.HashLength)
return dl.accountList return dl.accountList