fix invariant check now that interest is calculated lazily

This commit is contained in:
Arvid Norberg 2011-11-03 09:20:16 +00:00
parent 2d6d76c525
commit 9a49372368
2 changed files with 10 additions and 9 deletions

View File

@ -3418,15 +3418,6 @@ namespace libtorrent
{
boost::shared_ptr<torrent> t = associated_torrent().lock();
if (!m_disconnect_started && m_initialized)
{
// none of this matters if we're disconnecting anyway
if (t->is_finished())
TORRENT_ASSERT(!is_interesting());
if (is_seed())
TORRENT_ASSERT(upload_only());
}
#ifndef TORRENT_DISABLE_ENCRYPTION
TORRENT_ASSERT( (bool(m_state != read_pe_dhkey) || m_dh_key_exchange.get())
|| !is_local());

View File

@ -5517,6 +5517,16 @@ namespace libtorrent
TORRENT_ASSERT(m_download_limit >= 0);
boost::shared_ptr<torrent> t = m_torrent.lock();
if (!m_disconnect_started && m_initialized)
{
// none of this matters if we're disconnecting anyway
if (t->is_finished())
TORRENT_ASSERT(!is_interesting());
if (is_seed())
TORRENT_ASSERT(upload_only());
}
if (m_disconnecting)
{
TORRENT_ASSERT(m_download_queue.empty());