core/state/snapshot: check it.fail error

This commit is contained in:
Gary Rong 2024-11-15 09:44:31 +08:00
parent 1b0705e2f5
commit cebc3312f3

View file

@ -121,10 +121,14 @@ func (it *binaryIterator) Next() bool {
if !it.next() {
return false
}
if len(it.Account()) == 0 && len(it.Slot()) == 0 {
continue
if len(it.Account()) != 0 || len(it.Slot()) != 0 {
return true
}
// it.fail might be set if error occurs by calling
// it.Account() or it.Slot(), stop iteration if so.
if it.fail != nil {
return false
}
return true
}
}