core/state, eth, trie: stabilize memory use, fix memory leak

This commit is contained in:
Péter Szilágyi
2020-08-26 13:05:06 +03:00
parent 63a9d4b2ae
commit d8da0b3d81
7 changed files with 58 additions and 29 deletions

View File

@ -226,12 +226,12 @@ func (c *committer) commitLoop(db *Database) {
switch n := n.(type) {
case *shortNode:
if child, ok := n.Val.(valueNode); ok {
c.onleaf(child, hash)
c.onleaf(nil, child, hash)
}
case *fullNode:
for i := 0; i < 16; i++ {
if child, ok := n.Children[i].(valueNode); ok {
c.onleaf(child, hash)
c.onleaf(nil, child, hash)
}
}
}