fixed bug in session_settings::disable_hash_checks

This commit is contained in:
Arvid Norberg
2010-11-07 21:41:03 +00:00
parent 02e15202f2
commit 6ba977aa9b

View File

@@ -1214,6 +1214,8 @@ namespace libtorrent
int piece_size = j.storage->info()->piece_size(j.piece);
int blocks_in_piece = (piece_size + m_block_size - 1) / m_block_size;
if (!m_settings.disable_hash_checks)
{
hasher ctx;
for (int i = 0; i < blocks_in_piece; ++i)
@@ -1223,6 +1225,7 @@ namespace libtorrent
piece_size -= m_block_size;
}
h = ctx.final();
}
ret = copy_from_piece(const_cast<cached_piece_entry&>(*p), hit, j, l);
TORRENT_ASSERT(ret > 0);