Skip to content

Commit fafc29f

Browse files
aaronbuchwaldqinglin89
authored andcommitted
trie: fix size accounting in cleaner (ethereum#25007)
Decrease children size instead of dirties size when marking dirties as cleaned up in trie cleaner
1 parent ce9dae2 commit fafc29f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

trie/database.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,7 @@ func (c *cleaner) Put(key []byte, rlp []byte) error {
838838
delete(c.db.dirties, hash)
839839
c.db.dirtiesSize -= common.StorageSize(common.HashLength + int(node.size))
840840
if node.children != nil {
841-
c.db.dirtiesSize -= common.StorageSize(cachedNodeChildrenSize + len(node.children)*(common.HashLength+2))
841+
c.db.childrenSize -= common.StorageSize(cachedNodeChildrenSize + len(node.children)*(common.HashLength+2))
842842
}
843843
// Move the flushed node into the clean cache to prevent insta-reloads
844844
if c.db.cleans != nil {

0 commit comments

Comments
 (0)