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)