mirror of
https://github.com/transmission/transmission.git
synced 2025-12-19 18:08:31 +00:00
fix: wrong tier value in torrent get tracker stat response (#5274)
This commit is contained in:
@@ -1733,18 +1733,21 @@ tr_tracker_view tr_announcerTracker(tr_torrent const* tor, size_t nth)
|
||||
TR_ASSERT(tr_isTorrent(tor));
|
||||
TR_ASSERT(tor->torrent_announcer != nullptr);
|
||||
|
||||
auto i = size_t{ 0 };
|
||||
auto tier_index = size_t{ 0 };
|
||||
auto tracker_index = size_t{ 0 };
|
||||
for (auto const& tier : tor->torrent_announcer->tiers)
|
||||
{
|
||||
for (auto const& tracker : tier.trackers)
|
||||
{
|
||||
if (i == nth)
|
||||
if (tracker_index == nth)
|
||||
{
|
||||
return trackerView(*tor, i, tier, tracker);
|
||||
return trackerView(*tor, tier_index, tier, tracker);
|
||||
}
|
||||
|
||||
++i;
|
||||
++tracker_index;
|
||||
}
|
||||
|
||||
++tier_index;
|
||||
}
|
||||
|
||||
TR_ASSERT(false);
|
||||
|
||||
Reference in New Issue
Block a user