Do not list not contacted trackers as error

This commit is contained in:
an0n666 2020-02-14 09:39:57 +00:00 committed by sledgehammer999
parent 868fd53551
commit d15fdf2dde
No known key found for this signature in database
GPG key ID: 6E4A2D025B7CC9A2

View file

@ -1654,14 +1654,13 @@ void TorrentHandle::handleTrackerErrorAlert(const lt::tracker_error_alert *p)
// Starting with libtorrent 1.2.x each tracker has multiple local endpoints from which
// an announce is attempted. Some endpoints might succeed while others might fail.
// Emit the signal only if all endpoints have failed. TrackerEntry::isWorking() returns
// true if at least one endpoint works.
// Emit the signal only if all endpoints have failed.
const QVector<TrackerEntry> trackerList = trackers();
const auto iter = std::find_if(trackerList.cbegin(), trackerList.cend(), [&trackerUrl](const TrackerEntry &entry)
{
return (entry.url() == trackerUrl);
});
if ((iter != trackerList.cend()) && !iter->isWorking())
if ((iter != trackerList.cend()) && (iter->status() == TrackerEntry::NotWorking))
m_session->handleTorrentTrackerError(this, trackerUrl);
}