From 7cd628e78deb7dca26a046c7ce4fbd5543686813 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Tue, 23 Nov 2010 20:36:27 +0000 Subject: [PATCH] fix for unchoking optimistically unchoked peers --- src/peer_connection.cpp | 3 ++- src/torrent.cpp | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/peer_connection.cpp b/src/peer_connection.cpp index e7f5028f5..3477a3787 100644 --- a/src/peer_connection.cpp +++ b/src/peer_connection.cpp @@ -2958,7 +2958,8 @@ namespace libtorrent { 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; write_choke(); diff --git a/src/torrent.cpp b/src/torrent.cpp index ab55b6d0c..e9ba2e19f 100644 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -6920,8 +6920,8 @@ namespace libtorrent TORRENT_ASSERT(b > 0); m_total_redundant_bytes += b; m_ses.add_redundant_bytes(b); - TORRENT_ASSERT(m_total_redundant_bytes + m_total_failed_bytes - <= m_stat.total_payload_download()); +// TORRENT_ASSERT(m_total_redundant_bytes + m_total_failed_bytes +// <= m_stat.total_payload_download()); } void torrent::add_failed_bytes(int b)