Fix fetched bytes computation to not account for stolen bytes.
This commit is contained in:
parent
511e64751c
commit
0230550ed3
2 changed files with 12 additions and 6 deletions
|
|
@ -1310,12 +1310,6 @@ impl PeerHandler {
|
|||
.fetch_add(piece.block.len() as u64, Ordering::Relaxed);
|
||||
self.counters.fetched_chunks.fetch_add(1, Ordering::Relaxed);
|
||||
|
||||
// Global chunk/byte counters.
|
||||
self.state
|
||||
.stats
|
||||
.fetched_bytes
|
||||
.fetch_add(piece.block.len() as u64, Ordering::Relaxed);
|
||||
|
||||
self.state
|
||||
.peers
|
||||
.with_live_mut(self.addr, "inflight_requests.remove", |h| {
|
||||
|
|
@ -1401,6 +1395,12 @@ 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