mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-24 14:51:14 +00:00
Fixed shared cache race on import (#4194)
* Fixed is_best race on import * Take import lock outside of backend * Actually take the lock
This commit is contained in:
committed by
Gavin Wood
parent
50b84a6438
commit
d56d6163ef
@@ -18,7 +18,7 @@
|
||||
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use std::sync::Arc;
|
||||
use parking_lot::{RwLock, Mutex};
|
||||
use parking_lot::RwLock;
|
||||
use primitives::{ChangesTrieConfiguration, storage::well_known_keys};
|
||||
use primitives::offchain::storage::{
|
||||
InMemOffchainStorage as OffchainStorage
|
||||
@@ -562,7 +562,7 @@ where
|
||||
states: RwLock<HashMap<Block::Hash, InMemory<H>>>,
|
||||
changes_trie_storage: ChangesTrieStorage<Block, H>,
|
||||
blockchain: Blockchain<Block>,
|
||||
import_lock: Mutex<()>,
|
||||
import_lock: RwLock<()>,
|
||||
}
|
||||
|
||||
impl<Block, H> Backend<Block, H>
|
||||
@@ -712,7 +712,7 @@ where
|
||||
Ok(Zero::zero())
|
||||
}
|
||||
|
||||
fn get_import_lock(&self) -> &Mutex<()> {
|
||||
fn get_import_lock(&self) -> &RwLock<()> {
|
||||
&self.import_lock
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user