diff --git a/clients/client-core/src/config/mod.rs b/clients/client-core/src/config/mod.rs index be7244fe97..cde306379c 100644 --- a/clients/client-core/src/config/mod.rs +++ b/clients/client-core/src/config/mod.rs @@ -239,6 +239,10 @@ impl Config { self.debug.topology_resolution_timeout } + pub fn get_disabled_loop_cover_traffic_stream(&self) -> bool { + self.debug.disable_loop_cover_traffic_stream + } + pub fn get_version(&self) -> &str { &self.client.version } @@ -449,6 +453,10 @@ pub struct Debug { /// did not reach its destination. #[serde(with = "humantime_serde")] pub topology_resolution_timeout: Duration, + + /// Controls whether the dedicated loop cover traffic stream should be enabled. + /// (and sending packets, on average, every [Self::loop_cover_traffic_average_delay]) + disable_loop_cover_traffic_stream: bool, } impl Default for Debug { @@ -463,6 +471,7 @@ impl Default for Debug { gateway_response_timeout: DEFAULT_GATEWAY_RESPONSE_TIMEOUT, topology_refresh_rate: DEFAULT_TOPOLOGY_REFRESH_RATE, topology_resolution_timeout: DEFAULT_TOPOLOGY_RESOLUTION_TIMEOUT, + disable_loop_cover_traffic_stream: false, } } } diff --git a/clients/native/src/client/mod.rs b/clients/native/src/client/mod.rs index 3ad6addfe0..9a2fc32c0b 100644 --- a/clients/native/src/client/mod.rs +++ b/clients/native/src/client/mod.rs @@ -398,11 +398,17 @@ impl NymClient { shutdown.subscribe(), ); - self.start_cover_traffic_stream( - shared_topology_accessor, - sphinx_message_sender, - shutdown.subscribe(), - ); + if !self + .config + .get_base() + .get_disabled_loop_cover_traffic_stream() + { + self.start_cover_traffic_stream( + shared_topology_accessor, + sphinx_message_sender, + shutdown.subscribe(), + ); + } match self.config.get_socket_type() { SocketType::WebSocket => { diff --git a/clients/socks5/src/client/mod.rs b/clients/socks5/src/client/mod.rs index ce89c29a26..966f0545f0 100644 --- a/clients/socks5/src/client/mod.rs +++ b/clients/socks5/src/client/mod.rs @@ -388,11 +388,18 @@ impl NymClient { shutdown.subscribe(), ); - self.start_cover_traffic_stream( - shared_topology_accessor, - sphinx_message_sender, - shutdown.subscribe(), - ); + if !self + .config + .get_base() + .get_disabled_loop_cover_traffic_stream() + { + self.start_cover_traffic_stream( + shared_topology_accessor, + sphinx_message_sender, + shutdown.subscribe(), + ); + } + self.start_socks5_listener( received_buffer_request_sender, input_sender,