Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

ethcore/light: fix deadlock caused by conflicting lock order #11768

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions ethcore/light/src/client/header_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -823,10 +823,8 @@ impl HeaderChain {
/// The header corresponding the the parent hash must be stored already.
pub fn epoch_transition_for(&self, parent_hash: H256) -> Option<(Header, Vec<u8>)> {
// slow path: loop back block by block
let live_proofs = self.live_epoch_proofs.read();

for hdr in self.ancestry_iter(BlockId::Hash(parent_hash)) {
if let Some(transition) = live_proofs.get(&hdr.hash()).cloned() {
if let Some(transition) = self.live_epoch_proofs.read().get(&hdr.hash()).cloned() {
return hdr.decode().map(|decoded_hdr| {
(decoded_hdr, transition.proof)
}).ok();
Expand Down