fixup! refactor: add tr_torrentTrackers() (#2282) (#2294)

ensure announcer tracker count is correct
This commit is contained in:
Charles Kerr 2021-12-09 20:03:26 -06:00 committed by GitHub
parent 0f92232c65
commit 0cedfec630
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 8 deletions

View File

@ -1802,6 +1802,14 @@ static tr_tracker_view trackerView(tr_torrent const& tor, int tier_index, tr_tie
return view;
}
size_t tr_announcerTrackerCount(tr_torrent const* tor)
{
TR_ASSERT(tr_isTorrent(tor));
TR_ASSERT(tor->tiers != nullptr);
return tor->tiers->tracker_count;
}
tr_tracker_view tr_announcerTracker(tr_torrent const* tor, size_t nth)
{
TR_ASSERT(tr_isTorrent(tor));

View File

@ -95,6 +95,8 @@ time_t tr_announcerNextManualAnnounce(tr_torrent const*);
tr_tracker_view tr_announcerTracker(tr_torrent const* torrent, size_t i);
size_t tr_announcerTrackerCount(tr_torrent const* tor);
/***
****
***/

View File

@ -1255,7 +1255,7 @@ tr_tracker_view tr_torrentTracker(tr_torrent const* tor, size_t i)
size_t tr_torrentTrackerCount(tr_torrent const* tor)
{
return tor->trackerCount();
return tr_announcerTrackerCount(tor);
}
/***

View File

@ -348,13 +348,6 @@ public:
return info.webseeds[i];
}
/// TRACKERS
auto trackerCount() const
{
return info.trackerCount;
}
/// CHECKSUMS
bool ensurePieceIsChecked(tr_piece_index_t piece)