From 3f40890eb6a9b9f6c7286238845b0c67eb7f258b Mon Sep 17 00:00:00 2001 From: arvidn Date: Sat, 20 Feb 2016 15:45:46 -0500 Subject: [PATCH] simplify logic for saving resume a bit --- src/torrent.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/torrent.cpp b/src/torrent.cpp index 029efe41b..140c03a58 100644 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -7262,9 +7262,6 @@ namespace libtorrent // bit 0: set if we have the piece // bit 1: set if we have verified the piece (in seed mode) bool const is_checking = state() == torrent_status::checking_files; - bool const has_checked = state() == torrent_status::downloading - || state() == torrent_status::finished - || state() == torrent_status::seeding; // if we are checking, only save the have_pieces bitfield up to the piece // we have actually checked. This allows us to resume the checking when we @@ -7273,7 +7270,7 @@ namespace libtorrent // bitfield. int const max_piece = is_checking ? m_num_checked_pieces - : has_checked ? m_torrent_file->num_pieces() + : m_files_checked ? m_torrent_file->num_pieces() : 0; if (max_piece > 0)