From 00272bbaea1ab6ad1bd421fb44206e04f2c04f37 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Tue, 29 Mar 2005 23:47:13 +0000 Subject: [PATCH] fixed a bug where paused torrents would still get resources allocated for them --- src/torrent.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/torrent.cpp b/src/torrent.cpp index 47304260d..c5a09a2ae 100755 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -877,13 +877,6 @@ namespace libtorrent void torrent::second_tick(stat& accumulator) { - if (m_paused) - { - // let the stats fade out to 0 - m_stat.second_tick(); - return; - } - m_connections_quota.used = (int)m_connections.size(); m_uploads_quota.used = m_policy->num_uploads(); @@ -895,9 +888,16 @@ namespace libtorrent m_dl_bandwidth_quota.min = 0; m_dl_bandwidth_quota.max = 0; + if (m_paused) + { + // let the stats fade out to 0 + m_stat.second_tick(); + return; + } + + for (peer_iterator i = m_connections.begin(); - i != m_connections.end(); - ++i) + i != m_connections.end(); ++i) { peer_connection* p = i->second; m_stat += p->statistics();