diff --git a/src/piece_picker.cpp b/src/piece_picker.cpp index 7f44d600c..d50af5f75 100755 --- a/src/piece_picker.cpp +++ b/src/piece_picker.cpp @@ -828,6 +828,8 @@ namespace libtorrent , end(m_piece_map.end()); i != end; ++i) { int prev_prio = i->priority(m_sequenced_download_threshold); + assert(prev_prio < m_piece_info.size()); + assert(pushed_out_index < m_piece_info.size()); assert(i->peer_count > 0); --i->peer_count; // if the assumption that the priority would diff --git a/src/session_impl.cpp b/src/session_impl.cpp index 7a893e8fe..df2065a1a 100755 --- a/src/session_impl.cpp +++ b/src/session_impl.cpp @@ -1140,6 +1140,7 @@ namespace detail if (pi->optimistically_unchoked) { + assert(!p->is_choked()); assert(current_optimistic_unchoke == m_connections.end()); current_optimistic_unchoke = i; } @@ -2129,7 +2130,10 @@ namespace detail if (!i->second->is_choked()) ++unchokes; if (i->second->peer_info_struct() && i->second->peer_info_struct()->optimistically_unchoked) + { ++num_optimistic; + assert(!i->second->is_choked()); + } if (t) { assert(t->get_policy().has_connection(boost::get_pointer(i->second)));