only make snubbed peers invert the piece picking strategy when we're doing rarest first (i.e. snubbed peers do common-first). Specifically, this prevents snubbed peers from picking from the end of the torrent when in sequential mode

This commit is contained in:
Arvid Norberg 2018-10-26 15:42:10 +02:00 committed by Arvid Norberg
parent ba294e6594
commit 5b5b280b87
1 changed files with 9 additions and 8 deletions

View File

@ -880,15 +880,16 @@ namespace libtorrent
else
{
ret |= piece_picker::rarest_first;
}
if (m_snubbed)
{
// snubbed peers should request
// the common pieces first, just to make
// it more likely for all snubbed peers to
// request blocks from the same piece
ret |= piece_picker::reverse;
if (m_snubbed)
{
// snubbed peers should request
// the common pieces first, just to make
// it more likely for all snubbed peers to
// request blocks from the same piece
ret |= piece_picker::reverse;
}
}
if (m_settings.get_bool(settings_pack::prioritize_partial_pieces))