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:
Arkadiy Paronyan
2019-11-25 13:38:37 +01:00
committed by Gavin Wood
parent 50b84a6438
commit d56d6163ef
8 changed files with 56 additions and 48 deletions
+1 -1
View File
@@ -710,7 +710,7 @@ impl<B, E, Block, RA> Client<B, E, Block, RA> where
Err: From<error::Error>,
{
let inner = || {
let _import_lock = self.backend.get_import_lock().lock();
let _import_lock = self.backend.get_import_lock().write();
let mut op = ClientImportOperation {
op: self.backend.begin_operation()?,