From 7b6261a63ad265dc720fc677e5e9768b544cfc18 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Fri, 12 Jun 2009 06:20:08 +0000 Subject: [PATCH] fixed piece picker assert (would change the peer_count for pieces we have, and assert on them) --- src/piece_picker.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/piece_picker.cpp b/src/piece_picker.cpp index 4e5e89787..a9eb0ee6d 100644 --- a/src/piece_picker.cpp +++ b/src/piece_picker.cpp @@ -852,6 +852,8 @@ namespace libtorrent for (std::vector::iterator i = m_piece_map.begin() , end(m_piece_map.end()); i != end; ++i) { + // we don't maintain peer count for pieces we have + if (i->index == piece_pos::have_index) continue; TORRENT_ASSERT(i->peer_count > 0); --i->peer_count; }