mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-25 22:26:42 +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 {
|
if len(it.stack) == 0 {
|
||||||
// Initialize the iterator if we've just started.
|
// Initialize the iterator if we've just started.
|
||||||
root := it.trie.Hash()
|
root := it.trie.Hash()
|
||||||
it.stack = append(it.stack, &nodeIteratorState{
|
state := &nodeIteratorState{node: it.trie.root, child: -1}
|
||||||
hash: root,
|
if root != emptyRoot {
|
||||||
node: it.trie.root,
|
state.hash = root
|
||||||
child: -1,
|
}
|
||||||
})
|
it.stack = append(it.stack, state)
|
||||||
} else {
|
} else {
|
||||||
// Continue iterating at the previous node otherwise.
|
// Continue iterating at the previous node otherwise.
|
||||||
it.stack = it.stack[:len(it.stack)-1]
|
it.stack = it.stack[:len(it.stack)-1]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue