Skip to content

Commit 32b03ac

Browse files
aaronbuchwaldjagdeep sidhu
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 aa697a0 commit 32b03ac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

trie/database.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,7 @@ func (c *cleaner) Put(key []byte, rlp []byte) error {
812812
delete(c.db.dirties, hash)
813813
c.db.dirtiesSize -= common.StorageSize(common.HashLength + int(node.size))
814814
if node.children != nil {
815-
c.db.dirtiesSize -= common.StorageSize(cachedNodeChildrenSize + len(node.children)*(common.HashLength+2))
815+
c.db.childrenSize -= common.StorageSize(cachedNodeChildrenSize + len(node.children)*(common.HashLength+2))
816816
}
817817
// Move the flushed node into the clean cache to prevent insta-reloads
818818
if c.db.cleans != nil {

0 commit comments

Comments
 (0)