fix assert by only constructing piece_block with verified values
This commit is contained in:
parent
6f82d3b8ae
commit
5b292133cb
|
@ -2168,9 +2168,6 @@ namespace libtorrent
|
|||
boost::shared_ptr<torrent> t = associated_torrent().lock();
|
||||
TORRENT_ASSERT(t);
|
||||
|
||||
piece_block b(r.piece, r.start / t->block_size());
|
||||
m_receiving_block = b;
|
||||
|
||||
if (!verify_piece(r))
|
||||
{
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_ERROR_LOGGING
|
||||
|
@ -2181,6 +2178,9 @@ namespace libtorrent
|
|||
return;
|
||||
}
|
||||
|
||||
piece_block b(r.piece, r.start / t->block_size());
|
||||
m_receiving_block = b;
|
||||
|
||||
bool in_req_queue = false;
|
||||
for (std::vector<pending_block>::const_iterator i = m_download_queue.begin()
|
||||
, end(m_download_queue.end()); i != end; ++i)
|
||||
|
|
Loading…
Reference in New Issue