mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-10-22 11:46:20 +00:00
Make trie-cache resettable from backend (#14516)
* Add ability to reset trie-cache * comment * Update client/db/src/lib.rs Co-authored-by: Bastian Köcher <git@kchr.de> --------- Co-authored-by: Bastian Köcher <git@kchr.de>
This commit is contained in:
1 parent
892831e55c
commit
b6b1952fc6
1 file changed
+7
@@ -1124,6 +1124,13 @@ impl<Block: BlockT> Backend<Block> {
|
||||
Self::from_database(db as Arc<_>, canonicalization_delay, &db_config, needs_init)
|
||||
}
|
||||
|
||||
/// Reset the shared trie cache.
|
||||
pub fn reset_trie_cache(&self) {
|
||||
if let Some(cache) = &self.shared_trie_cache {
|
||||
cache.reset();
|
||||
}
|
||||
}
|
||||
|
||||
/// Create new memory-backed client backend for tests.
|
||||
#[cfg(any(test, feature = "test-helpers"))]
|
||||
pub fn new_test(blocks_pruning: u32, canonicalization_delay: u64) -> Self {
|
||||
|
||||
Reference in new issue
Block a user