init cache on restart (#3486)

This commit is contained in:
Svyatoslav Nikolsky authored and Bastian Köcher committed 2019-08-26 20:30:09 +02:00
1 parent b80e611218
commit 8f29199076
2 files changed
+28 -17

No files matched your search

+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 {