Tracker is errored only if all local endpoints fail

Closes #11691
This commit is contained in:
sledgehammer999 2019-12-23 00:28:00 +02:00
parent 7ceeea880e
commit 02a027144b
No known key found for this signature in database
GPG key ID: 6E4A2D025B7CC9A2
2 changed files with 17 additions and 5 deletions

View file

@ -54,9 +54,13 @@ QString TrackerEntry::url() const
bool TrackerEntry::isWorking() const
{
// lt::announce_entry::is_working() returns
// true when the tracker hasn't been tried yet.
#if (LIBTORRENT_VERSION_NUM < 10200)
return nativeEntry().is_working();
return nativeEntry().verified && nativeEntry().is_working();
#else
if (!nativeEntry().verified)
return false;
const auto &endpoints = nativeEntry().endpoints;
return std::any_of(endpoints.begin(), endpoints.end()
, [](const lt::announce_endpoint &endpoint)
@ -73,9 +77,7 @@ int TrackerEntry::tier() const
TrackerEntry::Status TrackerEntry::status() const
{
// lt::announce_entry::is_working() returns
// true when the tracker hasn't been tried yet.
if (nativeEntry().verified && isWorking())
if (isWorking())
return Working;
#if (LIBTORRENT_VERSION_NUM < 10200)