From bedbff5099156fe1d664622d52eb3ca522f4ce89 Mon Sep 17 00:00:00 2001 From: Boqin Qin Date: Fri, 19 Jun 2020 05:20:52 +0800 Subject: [PATCH] ethcore/private-tcx: fix deadlock caused by conflicting lock order (#11764) --- ethcore/private-tx/src/state_store.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethcore/private-tx/src/state_store.rs b/ethcore/private-tx/src/state_store.rs index ad567c533c1..014599dc56d 100644 --- a/ethcore/private-tx/src/state_store.rs +++ b/ethcore/private-tx/src/state_store.rs @@ -90,11 +90,11 @@ impl PrivateStateStorage { request_hashes: request_hashes.clone(), state: RequestState::Syncing, }; + let mut hashes = self.syncing_hashes.write(); let mut requests = self.requests.write(); requests.push(request); let mut new_hashes = Vec::new(); for hash in request_hashes { - let mut hashes = self.syncing_hashes.write(); if hashes.insert(hash, Instant::now() + Duration::from_millis(MAX_REQUEST_SESSION_DURATION)).is_none() { new_hashes.push(hash); }