diff --git a/src/bt_peer_connection.cpp b/src/bt_peer_connection.cpp index 6b1d1e750..af373a87f 100644 --- a/src/bt_peer_connection.cpp +++ b/src/bt_peer_connection.cpp @@ -414,13 +414,18 @@ namespace { if (!m_supports_fast) return; +#if TORRENT_USE_ASSERTS std::shared_ptr t = associated_torrent().lock(); TORRENT_ASSERT(t); TORRENT_ASSERT(t->valid_metadata()); +#endif #ifndef TORRENT_DISABLE_LOGGING if (should_log(peer_log_alert::outgoing_message)) { +#if !TORRENT_USE_ASSERTS + std::shared_ptr t = associated_torrent().lock(); +#endif peer_log(peer_log_alert::outgoing_message, "SUGGEST" , "piece: %d num_peers: %d", static_cast(piece) , t->has_picker() ? t->picker().get_availability(piece) : -1);