fix invalid invariant check

This commit is contained in:
Arvid Norberg 2012-02-09 07:46:23 +00:00
parent 98b3e6eb74
commit be339c244f
1 changed files with 8 additions and 2 deletions

View File

@ -5756,12 +5756,18 @@ namespace libtorrent
if (m_ses.settings().close_redundant_connections && !t->share_mode())
{
// make sure upload only peers are disconnected
if (t->is_upload_only() && m_upload_only)
if (t->is_upload_only()
&& m_upload_only
&& t->valid_metadata()
&& has_metadata())
TORRENT_ASSERT(m_disconnect_started || t->graceful_pause() || t->has_error());
if (m_upload_only
&& !m_interesting
&& m_bitfield_received
&& t->are_files_checked())
&& t->are_files_checked()
&& t->valid_metadata()
&& has_metadata())
TORRENT_ASSERT(m_disconnect_started);
}