mirror of https://github.com/status-im/op-geth.git
trie: fix size accounting in cleaner (#25007)
Decrease children size instead of dirties size when marking dirties as cleaned up in trie cleaner
This commit is contained in:
parent
ad15050c7f
commit
241dd27300
|
@ -812,7 +812,7 @@ func (c *cleaner) Put(key []byte, rlp []byte) error {
|
||||||
delete(c.db.dirties, hash)
|
delete(c.db.dirties, hash)
|
||||||
c.db.dirtiesSize -= common.StorageSize(common.HashLength + int(node.size))
|
c.db.dirtiesSize -= common.StorageSize(common.HashLength + int(node.size))
|
||||||
if node.children != nil {
|
if node.children != nil {
|
||||||
c.db.dirtiesSize -= common.StorageSize(cachedNodeChildrenSize + len(node.children)*(common.HashLength+2))
|
c.db.childrenSize -= common.StorageSize(cachedNodeChildrenSize + len(node.children)*(common.HashLength+2))
|
||||||
}
|
}
|
||||||
// Move the flushed node into the clean cache to prevent insta-reloads
|
// Move the flushed node into the clean cache to prevent insta-reloads
|
||||||
if c.db.cleans != nil {
|
if c.db.cleans != nil {
|
||||||
|
|
Loading…
Reference in New Issue