Browse Source

Set Peer::chokingRequired(true) for all active peer

Tatsuhiro Tsujikawa 9 years ago
parent
commit
12b903f312
1 changed files with 10 additions and 3 deletions
  1. 10 3
      src/BtLeecherStateChoke.cc

+ 10 - 3
src/BtLeecherStateChoke.cc

@@ -218,10 +218,17 @@ void BtLeecherStateChoke::executeChoke(const PeerSet& peerSet)
 
 
   std::vector<PeerEntry> peerEntries;
   std::vector<PeerEntry> peerEntries;
   for (const auto& p : peerSet) {
   for (const auto& p : peerSet) {
-    if (p->isActive() && !p->snubbing()) {
-      p->chokingRequired(true);
-      peerEntries.push_back(PeerEntry(p));
+    if (!p->isActive()) {
+      continue;
+    }
+
+    p->chokingRequired(true);
+
+    if (p->snubbing()) {
+      continue;
     }
     }
+
+    peerEntries.push_back(PeerEntry(p));
   }
   }
 
 
   // planned optimistic unchoke
   // planned optimistic unchoke