From 12b903f3121683cd287c2f27dfdcd1fc19bab894 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 5 Jun 2016 11:21:48 +0900 Subject: [PATCH] Set Peer::chokingRequired(true) for all active peer --- src/BtLeecherStateChoke.cc | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/BtLeecherStateChoke.cc b/src/BtLeecherStateChoke.cc index 98db9e3e..5c734a4f 100644 --- a/src/BtLeecherStateChoke.cc +++ b/src/BtLeecherStateChoke.cc @@ -218,10 +218,17 @@ void BtLeecherStateChoke::executeChoke(const PeerSet& peerSet) std::vector 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