mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
trie: move dirty data to clean cache on flush
This commit is contained in:
parent
f03402232c
commit
ed644a983d
1 changed files with 5 additions and 0 deletions
|
|
@ -784,6 +784,11 @@ func (db *Database) uncache(hash common.Hash) {
|
|||
}
|
||||
delete(db.dirties, hash)
|
||||
db.dirtiesSize -= common.StorageSize(common.HashLength + int(node.size))
|
||||
|
||||
// Move the flushed node into the clean cache to prevent insta-reloads
|
||||
if db.cleans != nil {
|
||||
db.cleans.Set(string(hash[:]), node.rlp())
|
||||
}
|
||||
}
|
||||
|
||||
// Size returns the current storage size of the memory cache in front of the
|
||||
|
|
|
|||
Loading…
Reference in a new issue