fix issue where want_tick could get out of sync with the lists the torrent belonged to

This commit is contained in:
arvidn 2020-03-04 12:51:26 +01:00 committed by Arvid Norberg
parent 65d6e83b1a
commit 06ce1b4747
1 changed files with 5 additions and 3 deletions

View File

@ -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();
}