mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
perf(tree): insert account cache only when not present (#14599)
This commit is contained in:
@ -356,11 +356,12 @@ impl ProviderCaches {
|
||||
key: StorageKey,
|
||||
value: Option<StorageValue>,
|
||||
) {
|
||||
let account_cache = self.storage_cache.get(&address).unwrap_or_default();
|
||||
|
||||
let account_cache = self.storage_cache.get(&address).unwrap_or_else(|| {
|
||||
let account_cache = AccountStorageCache::default();
|
||||
self.storage_cache.insert(address, account_cache.clone());
|
||||
account_cache
|
||||
});
|
||||
account_cache.insert_storage(key, value);
|
||||
|
||||
self.storage_cache.insert(address, account_cache);
|
||||
}
|
||||
|
||||
/// Invalidate storage for specific account
|
||||
|
||||
Reference in New Issue
Block a user