fixed the cause of an inconsistency in the piece picker and the torrent

This commit is contained in:
Arvid Norberg
2006-12-22 00:45:43 +00:00
parent f83db0a423
commit c69479a166
3 changed files with 60 additions and 22 deletions

View File

@@ -965,7 +965,12 @@ namespace libtorrent
assert(index < (int)m_piece_map.size());
assert(index >= 0);
if (m_piece_map[index].downloading == 0) return false;
if (m_piece_map[index].downloading == 0)
{
assert(std::find_if(m_downloads.begin(), m_downloads.end(), has_index(index))
== m_downloads.end());
return false;
}
std::vector<downloading_piece>::const_iterator i
= std::find_if(m_downloads.begin(), m_downloads.end(), has_index(index));
assert(i != m_downloads.end());