From e395747e35eb4d7280eb084ef194476a94346bd7 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sun, 8 Jul 2007 20:43:44 +0000 Subject: [PATCH] fixed piece picker bug --- src/policy.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/policy.cpp b/src/policy.cpp index 5bdb32ca2..7a4fc50c5 100755 --- a/src/policy.cpp +++ b/src/policy.cpp @@ -267,6 +267,7 @@ namespace libtorrent continue; } + assert(p.num_peers(*i) == 0); // ok, we found a piece that's not being downloaded // by somebody else. request it from this peer // and return @@ -279,7 +280,7 @@ namespace libtorrent // blocks as well, we cannot download anything // more from this peer. - if (busy_pieces.empty()) + if (busy_pieces.empty() || num_requests == 0) { c.send_block_requests(); return;