Ver Fonte

Fix bug that evaluation of Peer::amChoking is negated

Tatsuhiro Tsujikawa há 9 anos atrás
pai
commit
ef9e67aeb2
1 ficheiros alterados com 6 adições e 2 exclusões
  1. 6 2
      src/BtInterestedMessage.cc

+ 6 - 2
src/BtInterestedMessage.cc

@@ -59,8 +59,12 @@ void BtInterestedMessage::doReceivedAction()
   if (isMetadataGetMode()) {
     return;
   }
-  getPeer()->peerInterested(true);
-  if (!getPeer()->amChoking()) {
+
+  auto& peer = getPeer();
+
+  peer->peerInterested(true);
+
+  if (peer->amChoking()) {
     peerStorage_->executeChoke();
   }
 }