report disk read-back when verifying piece hashes
This commit is contained in:
@@ -2190,7 +2190,8 @@ namespace libtorrent
|
||||
|
||||
ptime hash_start = time_now_hires();
|
||||
|
||||
sha1_hash h = j.storage->hash_for_piece_impl(j.piece);
|
||||
int readback = 0;
|
||||
sha1_hash h = j.storage->hash_for_piece_impl(j.piece, &readback);
|
||||
if (test_error(j))
|
||||
{
|
||||
ret = -1;
|
||||
@@ -2198,6 +2199,8 @@ namespace libtorrent
|
||||
break;
|
||||
}
|
||||
|
||||
m_cache_stats.total_read_back += readback / m_block_size;
|
||||
|
||||
ret = (j.storage->info()->hash_for_piece(j.piece) == h)?0:-2;
|
||||
if (ret == -2) j.storage->mark_failed(j.piece);
|
||||
|
||||
|
Reference in New Issue
Block a user