mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-17 20:31:35 +00:00
trie/bintrie: free hashed node slot after iterator resolution
This commit is contained in:
parent
7351d8d1c1
commit
a9a2d5653c
1 changed files with 2 additions and 0 deletions
|
|
@ -139,6 +139,7 @@ func (it *binaryNodeIterator) Next(descend bool) bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update the stack and parent with the resolved node
|
// Update the stack and parent with the resolved node
|
||||||
|
oldHashedIdx := it.current.Index()
|
||||||
it.current = resolved
|
it.current = resolved
|
||||||
it.stack[len(it.stack)-1].Node = resolved
|
it.stack[len(it.stack)-1].Node = resolved
|
||||||
parent := &it.stack[len(it.stack)-2]
|
parent := &it.stack[len(it.stack)-2]
|
||||||
|
|
@ -148,6 +149,7 @@ func (it *binaryNodeIterator) Next(descend bool) bool {
|
||||||
} else {
|
} else {
|
||||||
parentNode.right = resolved
|
parentNode.right = resolved
|
||||||
}
|
}
|
||||||
|
it.store.freeHashedNode(oldHashedIdx)
|
||||||
return it.Next(descend)
|
return it.Next(descend)
|
||||||
|
|
||||||
case KindEmpty:
|
case KindEmpty:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue