fix for unchoking optimistically unchoked peers

This commit is contained in:
Arvid Norberg 2010-11-23 20:36:27 +00:00
parent d937716af0
commit 7cd628e78d
2 changed files with 4 additions and 3 deletions

View File

@ -2958,7 +2958,8 @@ namespace libtorrent
{ {
INVARIANT_CHECK; INVARIANT_CHECK;
TORRENT_ASSERT(!m_peer_info || !m_peer_info->optimistically_unchoked); if (m_peer_info && m_peer_info->optimistically_unchoked)
m_peer_info->optimistically_unchoked = false;
if (m_choked) return false; if (m_choked) return false;
write_choke(); write_choke();

View File

@ -6920,8 +6920,8 @@ namespace libtorrent
TORRENT_ASSERT(b > 0); TORRENT_ASSERT(b > 0);
m_total_redundant_bytes += b; m_total_redundant_bytes += b;
m_ses.add_redundant_bytes(b); m_ses.add_redundant_bytes(b);
TORRENT_ASSERT(m_total_redundant_bytes + m_total_failed_bytes // TORRENT_ASSERT(m_total_redundant_bytes + m_total_failed_bytes
<= m_stat.total_payload_download()); // <= m_stat.total_payload_download());
} }
void torrent::add_failed_bytes(int b) void torrent::add_failed_bytes(int b)