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

pull/675/head
Tatsuhiro Tsujikawa 2016-06-05 11:21:48 +09:00
parent e31a49b8ee
commit 12b903f312
1 changed files with 10 additions and 3 deletions

View File

@ -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