From 4ae349f61f9db00e6895066bab2e3e0796eea869 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Tue, 24 Apr 2012 18:43:56 +0000 Subject: [PATCH] make sure we don't download pieces while the torrent is checking --- src/peer_connection.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/peer_connection.cpp b/src/peer_connection.cpp index 62612aee5..7317028e8 100644 --- a/src/peer_connection.cpp +++ b/src/peer_connection.cpp @@ -3292,6 +3292,13 @@ namespace libtorrent return; } + // we can't download pieces in these states + if (t->state() == torrent_status::checking_files + || t->state() == torrent_status::checking_resume_data + || t->state() == torrent_status::downloading_metadata + || t->state() == torrent_status::allocating) + return; + if ((int)m_download_queue.size() >= m_desired_queue_size || t->upload_mode()) return;