diff --git a/src/base/bittorrent/torrentimpl.cpp b/src/base/bittorrent/torrentimpl.cpp index 5f59f996f..57ccb5c41 100644 --- a/src/base/bittorrent/torrentimpl.cpp +++ b/src/base/bittorrent/torrentimpl.cpp @@ -657,6 +657,9 @@ void TorrentImpl::removeTrackers(const QStringList &trackers) void TorrentImpl::replaceTrackers(QVector trackers) { trackers.removeIf([](const TrackerEntry &entry) { return entry.url.isEmpty(); }); + // Filter out duplicate trackers + const auto uniqueTrackers = QSet(trackers.cbegin(), trackers.cend()); + trackers = QVector(uniqueTrackers.cbegin(), uniqueTrackers.cend()); std::sort(trackers.begin(), trackers.end() , [](const TrackerEntry &lhs, const TrackerEntry &rhs) { return lhs.tier < rhs.tier; });