diff --git a/src/peer_connection.cpp b/src/peer_connection.cpp index 5ce04bcf4..8d1e5ff00 100644 --- a/src/peer_connection.cpp +++ b/src/peer_connection.cpp @@ -337,6 +337,11 @@ namespace libtorrent boost::shared_ptr t = m_torrent.lock(); TORRENT_ASSERT(t); + // if m_have_piece is 0, it means the connections + // have not been initialized yet. The interested + // flag will be updated once they are. + if (m_have_piece.size() == 0) return; + bool interested = false; if (!t->is_finished()) {