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

Commit

Permalink
ethcore/private-tcx: fix deadlock caused by conflicting lock order (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Boqin Qin authored Jun 18, 2020
1 parent f37bce6 commit bedbff5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ethcore/private-tx/src/state_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit bedbff5

Please sign in to comment.