fixed assert in torrent::bytes_done()

This commit is contained in:
Arvid Norberg 2009-01-24 18:11:06 +00:00
parent 11c21f2abe
commit fe94f17835
1 changed files with 3 additions and 2 deletions

View File

@ -1365,12 +1365,13 @@ namespace libtorrent
TORRENT_ASSERT(st.total_wanted >= m_padding);
TORRENT_ASSERT(st.total_wanted >= 0);
TORRENT_ASSERT(st.total_wanted >= m_torrent_file->piece_length()
* (m_torrent_file->num_pieces() - 1));
if (!valid_metadata() || m_torrent_file->num_pieces() == 0)
return;
TORRENT_ASSERT(st.total_wanted >= m_torrent_file->piece_length()
* (m_torrent_file->num_pieces() - 1));
const int last_piece = m_torrent_file->num_pieces() - 1;
const int piece_size = m_torrent_file->piece_length();