fixed piece picker assert (would change the peer_count for pieces we have, and assert on them)

This commit is contained in:
Arvid Norberg 2009-06-12 06:20:08 +00:00
parent 3e23029670
commit 7b6261a63a
1 changed files with 2 additions and 0 deletions

View File

@ -852,6 +852,8 @@ namespace libtorrent
for (std::vector<piece_pos>::iterator i = m_piece_map.begin()
, end(m_piece_map.end()); i != end; ++i)
{
// we don't maintain peer count for pieces we have
if (i->index == piece_pos::have_index) continue;
TORRENT_ASSERT(i->peer_count > 0);
--i->peer_count;
}