Patch for concurrent iterator & others (onto v1.11.6) #386

Closed
roysc wants to merge 1565 commits from v1.11.6-statediff-v5 into master
Showing only changes of commit a8bb49b8ea - Show all commits

View File

@ -62,16 +62,14 @@ func (al accessList) equal(other accessList) bool {
if len(al) != len(other) { if len(al) != len(other) {
return false return false
} }
// Given that len(al) == len(other), we only need to check that
// all the items from al are in other.
for addr := range al { for addr := range al {
if _, ok := other[addr]; !ok { if _, ok := other[addr]; !ok {
return false return false
} }
} }
for addr := range other {
if _, ok := al[addr]; !ok {
return false
}
}
// Accounts match, cross reference the storage slots too // Accounts match, cross reference the storage slots too
for addr, slots := range al { for addr, slots := range al {
otherslots := other[addr] otherslots := other[addr]
@ -79,16 +77,13 @@ func (al accessList) equal(other accessList) bool {
if len(slots) != len(otherslots) { if len(slots) != len(otherslots) {
return false return false
} }
// Given that len(slots) == len(otherslots), we only need to check that
// all the items from slots are in otherslots.
for hash := range slots { for hash := range slots {
if _, ok := otherslots[hash]; !ok { if _, ok := otherslots[hash]; !ok {
return false return false
} }
} }
for hash := range otherslots {
if _, ok := slots[hash]; !ok {
return false
}
}
} }
return true return true
} }