From 46e0d66e2deea33c9ada4b4767f59c110255da65 Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Thu, 19 Sep 2024 14:58:43 +1000 Subject: [PATCH] Fix deadlock on block cache. (#6412) * Fix deadlock on block cache. --- beacon_node/beacon_chain/src/eth1_chain.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/beacon_node/beacon_chain/src/eth1_chain.rs b/beacon_node/beacon_chain/src/eth1_chain.rs index 9e1bcbe6fa8..2252d5b9c92 100644 --- a/beacon_node/beacon_chain/src/eth1_chain.rs +++ b/beacon_node/beacon_chain/src/eth1_chain.rs @@ -475,10 +475,10 @@ impl Eth1ChainBackend for CachingEth1Backend { voting_period_start_slot, ); - let blocks = self.core.blocks().read(); - - let votes_to_consider = - get_votes_to_consider(blocks.iter(), voting_period_start_seconds, spec); + let votes_to_consider = { + let blocks = self.core.blocks().read(); + get_votes_to_consider(blocks.iter(), voting_period_start_seconds, spec) + }; trace!( self.log,