added more asserts to make sure m_num_pieces is >= the number of pieces the piece picker thinks we have

This commit is contained in:
Arvid Norberg 2007-12-15 22:51:03 +00:00
parent 7f06272454
commit 0943c0d299
1 changed files with 3 additions and 0 deletions

View File

@ -1246,6 +1246,7 @@ namespace libtorrent
TORRENT_ASSERT(index < m_torrent_file->num_pieces());
bool filter_updated = m_picker->set_piece_priority(index, priority);
TORRENT_ASSERT(m_num_pieces >= m_picker->num_have_filtered());
if (filter_updated) update_peer_interest();
}
@ -1282,6 +1283,7 @@ namespace libtorrent
TORRENT_ASSERT(*i >= 0);
TORRENT_ASSERT(*i <= 7);
filter_updated |= m_picker->set_piece_priority(index, *i);
TORRENT_ASSERT(m_num_pieces >= m_picker->num_have_filtered());
}
if (filter_updated) update_peer_interest();
}
@ -2617,6 +2619,7 @@ namespace libtorrent
{
TORRENT_ASSERT(m_picker->num_peers(i->first) == i->second);
}
TORRENT_ASSERT(m_num_pieces >= m_picker->num_have_filtered());
}
if (valid_metadata())