From d6cef0952c9dc690d5e41f05141aaa6ef1f55433 Mon Sep 17 00:00:00 2001 From: Igor Katson Date: Sun, 19 Nov 2023 23:04:13 +0000 Subject: [PATCH] Remove an instance of double-locking in the same scope --- crates/librqbit/src/torrent_state.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/librqbit/src/torrent_state.rs b/crates/librqbit/src/torrent_state.rs index a1dd065..ddb0f79 100644 --- a/crates/librqbit/src/torrent_state.rs +++ b/crates/librqbit/src/torrent_state.rs @@ -1287,11 +1287,11 @@ impl PeerHandler { ); { let mut g = self.state.lock_write("mark_piece_downloaded"); - g.chunks.mark_piece_downloaded(chunk_info.piece_index); - self.state.peers.reset_peer_backoff(handle); } + self.state.peers.reset_peer_backoff(handle); + debug!("piece={} successfully downloaded and verified", index); if self.state.is_finished() {