core/state/snapshot: fix various iteration issues due to destruct set
This commit is contained in:
@ -493,12 +493,14 @@ func (dl *diffLayer) AccountList() []common.Hash {
|
||||
defer dl.lock.Unlock()
|
||||
|
||||
dl.accountList = make([]common.Hash, 0, len(dl.destructSet)+len(dl.accountData))
|
||||
for hash := range dl.destructSet {
|
||||
dl.accountList = append(dl.accountList, hash)
|
||||
}
|
||||
for hash := range dl.accountData {
|
||||
dl.accountList = append(dl.accountList, hash)
|
||||
}
|
||||
for hash := range dl.destructSet {
|
||||
if _, ok := dl.accountData[hash]; !ok {
|
||||
dl.accountList = append(dl.accountList, hash)
|
||||
}
|
||||
}
|
||||
sort.Sort(hashes(dl.accountList))
|
||||
return dl.accountList
|
||||
}
|
||||
|
Reference in New Issue
Block a user