mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-10 05:09:22 +00:00
Clean up lock acquisition
This commit is contained in:
@@ -351,8 +351,11 @@ where
|
|||||||
let (header, body) = block.clone().deconstruct();
|
let (header, body) = block.clone().deconstruct();
|
||||||
let parent = *header.parent_hash();
|
let parent = *header.parent_hash();
|
||||||
let number = *header.number();
|
let number = *header.number();
|
||||||
|
|
||||||
|
let mut queue_write = self.queue.write().await;
|
||||||
*self.importing_block.write().unwrap() = Some(hash);
|
*self.importing_block.write().unwrap() = Some(hash);
|
||||||
self.queue.write().await.as_mut().unwrap().import_blocks(
|
|
||||||
|
queue_write.as_mut().unwrap().import_blocks(
|
||||||
// We do not want this block, which hasn't been confirmed, to be broadcast over the net
|
// We do not want this block, which hasn't been confirmed, to be broadcast over the net
|
||||||
// Substrate will generate notifications unless it's Genesis, which this isn't, InitialSync,
|
// Substrate will generate notifications unless it's Genesis, which this isn't, InitialSync,
|
||||||
// which changes telemtry behavior, or File, which is... close enough
|
// which changes telemtry behavior, or File, which is... close enough
|
||||||
@@ -372,7 +375,7 @@ where
|
|||||||
}],
|
}],
|
||||||
);
|
);
|
||||||
|
|
||||||
if !ImportFuture::new(hash, self.queue.write().await.as_mut().unwrap()).await {
|
if !ImportFuture::new(hash, queue_write.as_mut().unwrap()).await {
|
||||||
todo!()
|
todo!()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user