diff --git a/src/torrent.cpp b/src/torrent.cpp index d3fc722e5..765fa779c 100644 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -4525,9 +4525,6 @@ namespace { inc_stats_counter(counters::num_piece_failed); - if (m_ses.alerts().should_post()) - m_ses.alerts().emplace_alert(get_handle(), index); - std::vector::iterator it = std::lower_bound(m_predictive_pieces.begin() , m_predictive_pieces.end(), index); if (it != m_predictive_pieces.end() && *it == index) @@ -4728,6 +4725,9 @@ namespace { // ever downloaded for it. m_picker->restore_piece(j->piece); + if (m_ses.alerts().should_post()) + m_ses.alerts().emplace_alert(get_handle(), j->piece); + // we have to let the piece_picker know that // this piece failed the check as it can restore it // and mark it as being interesting for download