fixed bug in piece_picker

This commit is contained in:
Arvid Norberg 2007-05-03 19:25:18 +00:00
parent 577bda5266
commit b9cdfc2771
1 changed files with 2 additions and 1 deletions

View File

@ -1334,6 +1334,7 @@ namespace libtorrent
if (i->finished_blocks[block.block_index])
{
assert(i->requested_blocks[block.block_index]);
assert(std::find_if(m_downloads.begin(), m_downloads.end()
, has_index(block.piece_index)) == m_downloads.end());
return;
@ -1356,7 +1357,7 @@ namespace libtorrent
piece_pos& p = m_piece_map[block.piece_index];
int prio = p.priority(m_sequenced_download_threshold);
p.downloading = 0;
move(prio, p.index);
if (prio > 0) move(prio, p.index);
assert(std::find_if(m_downloads.begin(), m_downloads.end()
, has_index(block.piece_index)) == m_downloads.end());