Avoid acquiring another read lock while holding one to avoid potential deadlock (#6200)

* Avoid acquiring another read lock to avoid potential deadlock.
This commit is contained in:
Jimmy Chen
2024-07-30 23:48:28 +10:00
committed by GitHub
parent 75e934842e
commit 9b3b730159

View File

@@ -1129,7 +1129,7 @@ impl Service {
Ok(BlockCacheUpdateOutcome {
blocks_imported,
head_block_number: self.inner.block_cache.read().highest_block_number(),
head_block_number: block_cache.highest_block_number(),
})
}
}