Explorar o código

Fix bug that evaluation of Peer::amChoking is negated

Tatsuhiro Tsujikawa %!s(int64=9) %!d(string=hai) anos
pai
achega
ef9e67aeb2
Modificáronse 1 ficheiros con 6 adicións e 2 borrados
  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();
   }
 }