mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-12 01:41:36 +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
|
||||
oldHashedIdx := it.current.Index()
|
||||
it.current = resolved
|
||||
it.stack[len(it.stack)-1].Node = resolved
|
||||
parent := &it.stack[len(it.stack)-2]
|
||||
|
|
@ -148,6 +149,7 @@ func (it *binaryNodeIterator) Next(descend bool) bool {
|
|||
} else {
|
||||
parentNode.right = resolved
|
||||
}
|
||||
it.store.freeHashedNode(oldHashedIdx)
|
||||
return it.Next(descend)
|
||||
|
||||
case KindEmpty:
|
||||
|
|
|
|||
Loading…
Reference in a new issue