piece picker fix

This commit is contained in:
Arvid Norberg 2008-06-23 13:02:41 +00:00
parent 71c4f6f9b6
commit 665d508bc3
1 changed files with 3 additions and 0 deletions

View File

@ -1787,6 +1787,9 @@ namespace libtorrent
= std::find_if(m_downloads.begin(), m_downloads.end(), has_index(block.piece_index)); = std::find_if(m_downloads.begin(), m_downloads.end(), has_index(block.piece_index));
TORRENT_ASSERT(i != m_downloads.end()); TORRENT_ASSERT(i != m_downloads.end());
block_info& info = i->info[block.block_index]; block_info& info = i->info[block.block_index];
if (info.state == block_info::state_none)
mark_as_downloading(block, peer, piece_picker::none);
info.peer = peer; info.peer = peer;
TORRENT_ASSERT(info.state == block_info::state_requested); TORRENT_ASSERT(info.state == block_info::state_requested);
if (info.state == block_info::state_requested) --i->requested; if (info.state == block_info::state_requested) --i->requested;