From 14f3f330db315f2869c2b89b4c8ca056fa829ceb Mon Sep 17 00:00:00 2001 From: Luke Parker Date: Thu, 16 Nov 2023 13:32:15 -0500 Subject: [PATCH] Remove deadlock in cosign_evaluator --- coordinator/src/cosign_evaluator.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/coordinator/src/cosign_evaluator.rs b/coordinator/src/cosign_evaluator.rs index 050a7f8a..6507d729 100644 --- a/coordinator/src/cosign_evaluator.rs +++ b/coordinator/src/cosign_evaluator.rs @@ -256,8 +256,10 @@ impl CosignEvaluator { panic!("17% of validator sets (by stake) have co-signed a distinct chain"); } } else { - let mut latest_cosigns = self.latest_cosigns.write().await; - latest_cosigns.insert(cosign.network, (block.number(), cosign)); + { + let mut latest_cosigns = self.latest_cosigns.write().await; + latest_cosigns.insert(cosign.network, (block.number(), cosign)); + } self.update_latest_cosign().await; }