diff --git a/src/app.rs b/src/app.rs index 00414bc1..aafae5eb 100644 --- a/src/app.rs +++ b/src/app.rs @@ -50,7 +50,7 @@ pub async fn start(config: &Configuration, app_container: &AppContainer) -> Vec< let registar = Registar::default(); // Load peer keys - if app_container.tracker.is_private() { + if config.core.private { app_container .keys_handler .load_keys_from_database() @@ -59,7 +59,7 @@ pub async fn start(config: &Configuration, app_container: &AppContainer) -> Vec< } // Load whitelisted torrents - if app_container.tracker.is_listed() { + if config.core.listed { app_container .whitelist_manager .load_whitelist_from_database() @@ -70,7 +70,7 @@ pub async fn start(config: &Configuration, app_container: &AppContainer) -> Vec< // Start the UDP blocks if let Some(udp_trackers) = &config.udp_trackers { for udp_tracker_config in udp_trackers { - if app_container.tracker.is_private() { + if config.core.private { tracing::warn!( "Could not start UDP tracker on: {} while in private mode. UDP is not safe for private trackers!", udp_tracker_config.bind_address diff --git a/src/core/mod.rs b/src/core/mod.rs index 2151ec1e..ae728dc1 100644 --- a/src/core/mod.rs +++ b/src/core/mod.rs @@ -496,28 +496,10 @@ impl Tracker { }) } - /// Returns `true` is the tracker is in public mode. - #[must_use] - pub fn is_public(&self) -> bool { - !self.config.private - } - - /// Returns `true` is the tracker is in private mode. - #[must_use] - pub fn is_private(&self) -> bool { - self.config.private - } - - /// Returns `true` is the tracker is in whitelisted mode. - #[must_use] - pub fn is_listed(&self) -> bool { - self.config.listed - } - /// Returns `true` if the tracker requires authentication. #[must_use] pub fn requires_authentication(&self) -> bool { - self.is_private() + self.config.private } /// Returns `true` is the tracker is in whitelisted mode.