trie: ensure resolved nodes stay loaded
Commit 40cdcf1183
broke the optimisation which kept nodes resolved
during Get in the trie. The decoder assigned cache generation 0
unconditionally, causing resolved nodes to get flushed on Commit.
This commit fixes it and adds two tests.
This commit is contained in:
@ -58,7 +58,7 @@ func (h *hasher) hash(n node, db DatabaseWriter, force bool) (node, node, error)
|
||||
return hash, n, nil
|
||||
}
|
||||
if n.canUnload(h.cachegen, h.cachelimit) {
|
||||
// Evict the node from cache. All of its subnodes will have a lower or equal
|
||||
// Unload the node from cache. All of its subnodes will have a lower or equal
|
||||
// cache generation number.
|
||||
return hash, hash, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user