Better ETA
This commit is contained in:
parent
051e450c6f
commit
2b3980e40a
1 changed files with 2 additions and 4 deletions
|
|
@ -248,10 +248,8 @@ impl TorrentStateLive {
|
|||
let stats = state.stats_snapshot();
|
||||
let fetched = stats.fetched_bytes;
|
||||
let needed = state.initially_needed();
|
||||
// fetched can be too high in theory, so for safety make sure that it doesn't wrap around u64.
|
||||
let remaining = needed
|
||||
.wrapping_sub(fetched)
|
||||
.min(needed - stats.downloaded_and_checked_bytes);
|
||||
// TODO: this is too coarse.
|
||||
let remaining = needed - stats.downloaded_and_checked_bytes;
|
||||
state
|
||||
.down_speed_estimator
|
||||
.add_snapshot(fetched, Some(remaining), now);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue