mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-25 14:16:44 +00:00
trie: fixup iterator
This commit is contained in:
parent
ae9c64061f
commit
4f2b554b35
1 changed files with 5 additions and 5 deletions
|
|
@ -127,11 +127,11 @@ func (it *NodeIterator) step() error {
|
|||
if len(it.stack) == 0 {
|
||||
// Initialize the iterator if we've just started.
|
||||
root := it.trie.Hash()
|
||||
it.stack = append(it.stack, &nodeIteratorState{
|
||||
hash: root,
|
||||
node: it.trie.root,
|
||||
child: -1,
|
||||
})
|
||||
state := &nodeIteratorState{node: it.trie.root, child: -1}
|
||||
if root != emptyRoot {
|
||||
state.hash = root
|
||||
}
|
||||
it.stack = append(it.stack, state)
|
||||
} else {
|
||||
// Continue iterating at the previous node otherwise.
|
||||
it.stack = it.stack[:len(it.stack)-1]
|
||||
|
|
|
|||
Loading…
Reference in a new issue