Remove error case which shouldn't be an error

This commit is contained in:
Luke Parker 2022-11-02 22:39:49 -04:00
parent f4d622a34c
commit de0e6724bf
No known key found for this signature in database
GPG key ID: F9F1386DB1E119B6

View file

@ -47,6 +47,9 @@ where
mut block: BlockImportParams<T::Block, Self::Transaction>,
new_cache: HashMap<CacheKeyId, Vec<u8>>,
) -> Result<ImportResult, Self::Error> {
if self.client.status(BlockId::Hash(block.hash)).unwrap() == BlockStatus::InChain {
return Ok(ImportResult::AlreadyInChain);
}
self.check(&mut block).await?;
self.client.import_block(block, new_cache).await.map_err(Into::into)