mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-19 19:30:44 +00:00
core/state: fix comment
This commit is contained in:
parent
e376aba33f
commit
4308514161
1 changed files with 13 additions and 9 deletions
|
|
@ -30,8 +30,9 @@ import (
|
||||||
// Iterator is an iterator to step over all the accounts or the specific
|
// Iterator is an iterator to step over all the accounts or the specific
|
||||||
// storage in the specific state.
|
// storage in the specific state.
|
||||||
type Iterator interface {
|
type Iterator interface {
|
||||||
// Next steps the iterator forward one element, returning false if exhausted,
|
// Next steps the iterator forward one element. It returns false if the iterator
|
||||||
// or an error if iteration failed for some reason.
|
// is exhausted or if an error occurs. Any error encountered is retained and
|
||||||
|
// can be retrieved via Error().
|
||||||
Next() bool
|
Next() bool
|
||||||
|
|
||||||
// Error returns any failure that occurred during iteration, which might have
|
// Error returns any failure that occurred during iteration, which might have
|
||||||
|
|
@ -117,8 +118,9 @@ func newFlatAccountIterator(it snapshot.AccountIterator, preimage PreimageReader
|
||||||
return &flatAccountIterator{it: it, preimage: preimage}
|
return &flatAccountIterator{it: it, preimage: preimage}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Next steps the iterator forward one element, returning false if exhausted,
|
// Next steps the iterator forward one element. It returns false if the iterator
|
||||||
// or an error if iteration failed for some reason.
|
// is exhausted or if an error occurs. Any error encountered is retained and
|
||||||
|
// can be retrieved via Error().
|
||||||
func (ai *flatAccountIterator) Next() bool {
|
func (ai *flatAccountIterator) Next() bool {
|
||||||
if ai.err != nil {
|
if ai.err != nil {
|
||||||
return false
|
return false
|
||||||
|
|
@ -184,8 +186,9 @@ func newFlatStorageIterator(it snapshot.StorageIterator, preimage PreimageReader
|
||||||
return &flatStorageIterator{it: it, preimage: preimage}
|
return &flatStorageIterator{it: it, preimage: preimage}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Next steps the iterator forward one element, returning false if exhausted,
|
// Next steps the iterator forward one element. It returns false if the iterator
|
||||||
// or an error if iteration failed for some reason.
|
// is exhausted or if an error occurs. Any error encountered is retained and
|
||||||
|
// can be retrieved via Error().
|
||||||
func (si *flatStorageIterator) Next() bool {
|
func (si *flatStorageIterator) Next() bool {
|
||||||
return si.it.Next()
|
return si.it.Next()
|
||||||
}
|
}
|
||||||
|
|
@ -247,8 +250,9 @@ func newMerkleTrieIterator(tr Trie, start common.Hash, account bool) (*merkleIte
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Next steps the iterator forward one element, returning false if exhausted,
|
// Next steps the iterator forward one element. It returns false if the iterator
|
||||||
// or an error if iteration failed for some reason.
|
// is exhausted or if an error occurs. Any error encountered is retained and
|
||||||
|
// can be retrieved via Error().
|
||||||
func (ti *merkleIterator) Next() bool {
|
func (ti *merkleIterator) Next() bool {
|
||||||
return ti.it.Next()
|
return ti.it.Next()
|
||||||
}
|
}
|
||||||
|
|
@ -383,7 +387,7 @@ func (si *stateIteratee) NewStorageIterator(addressHash common.Hash, start commo
|
||||||
return newFlatStorageIterator(it, si.triedb), nil
|
return newFlatStorageIterator(it, si.triedb), nil
|
||||||
}
|
}
|
||||||
if !si.merkle {
|
if !si.merkle {
|
||||||
return nil, fmt.Errorf("state %x is not available for account traversal", si.root)
|
return nil, fmt.Errorf("state %x is not available for storage traversal", si.root)
|
||||||
}
|
}
|
||||||
// The snapshot is not usable so far, construct the storage iterator from
|
// The snapshot is not usable so far, construct the storage iterator from
|
||||||
// the trie as the fallback. It's not as efficient as the flat state iterator.
|
// the trie as the fallback. It's not as efficient as the flat state iterator.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue