Download speed: dont lag behind disk
This commit is contained in:
parent
648c4edf71
commit
d2e37ead51
1 changed files with 6 additions and 7 deletions
|
|
@ -1368,9 +1368,14 @@ impl PeerHandler {
|
|||
}
|
||||
};
|
||||
|
||||
// This one is used to calculate download speed.
|
||||
self.state
|
||||
.stats
|
||||
.fetched_bytes
|
||||
.fetch_add(piece.block.len() as u64, Ordering::Relaxed);
|
||||
|
||||
// By this time we reach here, no other peer can for this piece. All others, even if they steal pieces would
|
||||
// have fallen off above in one of the defensive checks.
|
||||
|
||||
self.state
|
||||
.meta
|
||||
.spawner
|
||||
|
|
@ -1393,12 +1398,6 @@ impl PeerHandler {
|
|||
}
|
||||
}
|
||||
|
||||
// Global chunk/byte counters.
|
||||
self.state
|
||||
.stats
|
||||
.fetched_bytes
|
||||
.fetch_add(piece.block.len() as u64, Ordering::Relaxed);
|
||||
|
||||
let full_piece_download_time = match full_piece_download_time {
|
||||
Some(t) => t,
|
||||
None => return Ok(()),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue