diff --git a/src/peer_connection.cpp b/src/peer_connection.cpp index 94f498ad0..5e602b647 100644 --- a/src/peer_connection.cpp +++ b/src/peer_connection.cpp @@ -1158,6 +1158,18 @@ namespace libtorrent boost::shared_ptr t = m_torrent.lock(); TORRENT_ASSERT(t); + if (!is_choked()) + { + if (m_peer_info && m_peer_info->optimistically_unchoked) + { + m_peer_info->optimistically_unchoked = false; + m_ses.m_optimistic_unchoke_time_scaler = 0; + } + t->choke_peer(*this); + --m_ses.m_num_unchoked; + m_ses.m_unchoke_time_scaler = 0; + } + t->get_policy().not_interested(*this); }