浏览代码

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

Tatsuhiro Tsujikawa 9 年之前
父节点
当前提交
12b903f312
共有 1 个文件被更改,包括 10 次插入3 次删除
  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;
   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