From 5b292133cbfe1269f1667e139e2f235b900582ce Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sun, 16 Mar 2014 07:30:44 +0000 Subject: [PATCH] fix assert by only constructing piece_block with verified values --- src/peer_connection.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/peer_connection.cpp b/src/peer_connection.cpp index 4c0eda8a4..a5a3bd3b7 100644 --- a/src/peer_connection.cpp +++ b/src/peer_connection.cpp @@ -2168,9 +2168,6 @@ namespace libtorrent boost::shared_ptr 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::const_iterator i = m_download_queue.begin() , end(m_download_queue.end()); i != end; ++i)