init cache on restart (#3486)

This commit is contained in:
Svyatoslav Nikolsky
2019-08-26 21:30:09 +03:00
committed by Bastian Köcher
parent b80e611218
commit 8f29199076
2 changed files with 28 additions and 17 deletions
+2 -2
View File
@@ -299,8 +299,8 @@ impl<Block: BlockT> BlockchainCache<Block> for DbCacheSync<Block> {
key: &CacheKeyId,
at: &BlockId<Block>,
) -> Option<((NumberFor<Block>, Block::Hash), Option<(NumberFor<Block>, Block::Hash)>, Vec<u8>)> {
let cache = self.0.read();
let storage = cache.cache_at.get(key)?.storage();
let mut cache = self.0.write();
let storage = cache.get_cache(*key).storage();
let db = storage.db();
let columns = storage.columns();
let at = match *at {