trie: add start key to NodeIterator constructors
The 'step' method is split into two parts, 'peek' and 'push'. peek returns the next state but doesn't make it current. The end of iteration was previously tracked by setting 'trie' to nil. End of iteration is now tracked using the 'iteratorEnd' error, which is slightly cleaner and requires less code.
This commit is contained in:
@ -80,7 +80,7 @@ func checkTrieConsistency(db Database, root common.Hash) error {
|
||||
if err != nil {
|
||||
return nil // // Consider a non existent state consistent
|
||||
}
|
||||
it := trie.NodeIterator()
|
||||
it := trie.NodeIterator(nil)
|
||||
for it.Next(true) {
|
||||
}
|
||||
return it.Error()
|
||||
|
Reference in New Issue
Block a user