mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-12 01:41:36 +00:00
core/state: terminate Next if error is not nil in iterator
This commit is contained in:
parent
028ccebd23
commit
de1eb6782f
1 changed files with 6 additions and 0 deletions
|
|
@ -189,6 +189,9 @@ func newFlatStorageIterator(it snapshot.StorageIterator, preimage PreimageReader
|
|||
// is exhausted or if an error occurs. Any error encountered is retained and
|
||||
// can be retrieved via Error().
|
||||
func (si *flatStorageIterator) Next() bool {
|
||||
if si.err != nil {
|
||||
return false
|
||||
}
|
||||
return si.it.Next()
|
||||
}
|
||||
|
||||
|
|
@ -263,6 +266,9 @@ func newMerkleTrieIterator(tr Trie, start common.Hash, account bool) (*merkleIte
|
|||
// is exhausted or if an error occurs. Any error encountered is retained and
|
||||
// can be retrieved via Error().
|
||||
func (ti *merkleIterator) Next() bool {
|
||||
if ti.err != nil {
|
||||
return false
|
||||
}
|
||||
return ti.it.Next()
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue