Skip to content

Commit

Permalink
refactor: [#1182] remove unused methods
Browse files Browse the repository at this point in the history
  • Loading branch information
josecelano committed Jan 15, 2025
1 parent 439493d commit 39d1620
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 24 deletions.
24 changes: 1 addition & 23 deletions src/core/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ pub struct Tracker {
keys: tokio::sync::RwLock<std::collections::HashMap<Key, auth::PeerKey>>,

/// The list of allowed torrents. Only for listed trackers.
whitelist_manager: WhiteListManager,
pub whitelist_manager: WhiteListManager,

/// The in-memory torrents repository.
torrents: Arc<Torrents>,
Expand Down Expand Up @@ -1073,10 +1073,6 @@ impl Tracker {
self.whitelist_manager.add_torrent_to_whitelist(info_hash).await
}

pub async fn add_torrent_to_memory_whitelist(&self, info_hash: &InfoHash) -> bool {
self.whitelist_manager.add_torrent_to_memory_whitelist(info_hash).await
}

/// It removes a torrent from the whitelist.
/// Removing torrents is not relevant to public trackers.
///
Expand All @@ -1089,24 +1085,6 @@ impl Tracker {
self.whitelist_manager.remove_torrent_from_whitelist(info_hash).await
}

/// It removes a torrent from the whitelist in the database.
///
/// # Context: Whitelist
///
/// # Errors
///
/// Will return a `database::Error` if unable to remove the `info_hash` from the whitelist database.
pub fn remove_torrent_from_database_whitelist(&self, info_hash: &InfoHash) -> Result<(), databases::error::Error> {
self.whitelist_manager.remove_torrent_from_database_whitelist(info_hash)
}

/// It removes a torrent from the whitelist in memory.
///
/// # Context: Whitelist
pub async fn remove_torrent_from_memory_whitelist(&self, info_hash: &InfoHash) -> bool {
self.whitelist_manager.remove_torrent_from_memory_whitelist(info_hash).await
}

/// It checks if a torrent is whitelisted.
///
/// # Context: Whitelist
Expand Down
2 changes: 1 addition & 1 deletion src/servers/udp/handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1391,7 +1391,7 @@ mod tests {

add_a_seeder(tracker.clone(), &remote_addr, &info_hash).await;

tracker.add_torrent_to_memory_whitelist(&info_hash.0.into()).await;
tracker.whitelist_manager.add_torrent_to_memory_whitelist(&info_hash.0.into()).await;

let request = build_scrape_request(&remote_addr, &info_hash);

Expand Down

0 comments on commit 39d1620

Please sign in to comment.