From 6ad54b98407d0e80d335498a6848135ed1ea8b30 Mon Sep 17 00:00:00 2001 From: Gary Yu Date: Mon, 1 Oct 2018 11:51:15 +0800 Subject: [PATCH] fix: mutex dead lock between difficulty_iter and txhashset_write (#1617) fix #1611 --- chain/src/chain.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chain/src/chain.rs b/chain/src/chain.rs index d56ae6c45..2f8d148e7 100644 --- a/chain/src/chain.rs +++ b/chain/src/chain.rs @@ -963,8 +963,8 @@ impl Chain { /// running backward. Specialized to return information pertaining to block /// difficulty calculation (timestamp and previous difficulties). pub fn difficulty_iter(&self) -> store::DifficultyIter { - let head = self.head.lock().unwrap(); let batch = self.store.batch().unwrap(); + let head = self.head.lock().unwrap(); store::DifficultyIter::from(head.last_block_h, batch) }