From 06ce1b474742ca88a1baaee5f240667423bcefd5 Mon Sep 17 00:00:00 2001 From: arvidn Date: Wed, 4 Mar 2020 12:51:26 +0100 Subject: [PATCH] fix issue where want_tick could get out of sync with the lists the torrent belonged to --- src/torrent.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/torrent.cpp b/src/torrent.cpp index 4973937da..d75f11798 100644 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -9101,9 +9101,9 @@ bool is_downloading_state(int const st) if (m_stat.low_pass_upload_rate() > 0 || m_stat.low_pass_download_rate() > 0) state_updated(); m_stat.second_tick(tick_interval_ms); - // if the rate is 0, there's no update because of network transfers - if (!(m_stat.low_pass_upload_rate() > 0 || m_stat.low_pass_download_rate() > 0)) - update_want_tick(); + + // the low pass transfer rate may just have dropped to 0 + update_want_tick(); return; } @@ -9214,6 +9214,8 @@ bool is_downloading_state(int const st) } } + // want_tick depends on whether the low pass transfer rates are non-zero + // or not. They may just have turned zero in this last tick. update_want_tick(); }