minor invariant check tweak

This commit is contained in:
Arvid Norberg 2013-11-10 10:49:57 +00:00
parent 4521b8c902
commit 5284de9d80
1 changed files with 8 additions and 7 deletions

View File

@ -5744,13 +5744,14 @@ namespace libtorrent
TORRENT_ASSERT(m_upload_limit >= 0);
TORRENT_ASSERT(m_download_limit >= 0);
// TODO: why does this invariant not hold?
/*
if (m_channel_state[upload_channel] & peer_info::bw_limit)
TORRENT_ASSERT(m_ses.m_upload_rate.is_queued(this));
if (m_channel_state[download_channel] & peer_info::bw_limit)
TORRENT_ASSERT(m_ses.m_download_rate.is_queued(this));
*/
// It's not obvious why this invariant breaks when the peer disconnects
if (!m_disconnecting)
{
if (m_channel_state[upload_channel] & peer_info::bw_limit)
TORRENT_ASSERT(m_ses.m_upload_rate.is_queued(this));
if (m_channel_state[download_channel] & peer_info::bw_limit)
TORRENT_ASSERT(m_ses.m_download_rate.is_queued(this));
}
boost::shared_ptr<torrent> t = m_torrent.lock();