diff --git a/client/Cargo.lock b/client/Cargo.lock index 843b1a0f44..73aaad3b78 100644 --- a/client/Cargo.lock +++ b/client/Cargo.lock @@ -1698,7 +1698,6 @@ dependencies = [ "aes-ctr 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "blake2 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", - "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "chacha 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "curve25519-dalek 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "hkdf 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/client/src/clients/mod.rs b/client/src/clients/mod.rs index d2da563ec0..df67c001ff 100644 --- a/client/src/clients/mod.rs +++ b/client/src/clients/mod.rs @@ -177,22 +177,30 @@ impl NymClient { ) { loop { println!("[OUT QUEUE] here I will be sending real traffic (or loop cover if nothing is available)"); - select! { + // TODO: consider replacing select macro with our own proper future definition with polling + let traffic_message = select! { real_message = input_rx.next() => { println!("[OUT QUEUE] - we got a real message!"); - let real_message = real_message.expect("The channel must have closed! - if the client hasn't crashed, it should have!"); + if real_message.is_none() { + eprintln!("Unexpected 'None' real message!"); + std::process::exit(1); + } + let real_message = real_message.unwrap(); println!("real: {:?}", real_message); - let encapsulated_message = utils::sphinx::encapsulate_message(real_message.0, real_message.1, &topology); - mix_tx.send(MixMessage(encapsulated_message.0, encapsulated_message.1)).await.unwrap(); + utils::sphinx::encapsulate_message(real_message.0, real_message.1, &topology) }, default => { println!("[OUT QUEUE] - no real message - going to send extra loop cover"); - let cover_message = utils::sphinx::loop_cover_message(our_info.address, our_info.identifier, &topology); - mix_tx.send(MixMessage(cover_message.0, cover_message.1)).await.unwrap(); + utils::sphinx::loop_cover_message(our_info.address, our_info.identifier, &topology) } }; + mix_tx + .send(MixMessage(traffic_message.0, traffic_message.1)) + .await + .unwrap(); + let delay_duration = Duration::from_secs_f64(MESSAGE_SENDING_AVERAGE_DELAY); tokio::time::delay_for(delay_duration).await; } diff --git a/client/src/lib.rs b/client/src/lib.rs index 5f1dc2a7c5..519c8b5bcb 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -1,3 +1,5 @@ +#![recursion_limit = "256"] + pub mod clients; pub mod identity; pub mod persistence; diff --git a/client/src/main.rs b/client/src/main.rs index 6d73a64713..ad038e45b5 100644 --- a/client/src/main.rs +++ b/client/src/main.rs @@ -1,3 +1,5 @@ +#![recursion_limit = "256"] + use clap::{App, Arg, ArgMatches, SubCommand}; use std::process; @@ -10,7 +12,7 @@ mod utils; fn main() { let arg_matches = App::new("Nym Client") - .version("0.1.0") + .version(built_info::PKG_VERSION) .author("Nymtech") .about("Implementation of the Nym Client") .subcommand( diff --git a/sfw-provider/sfw-provider-requests/Cargo.lock b/sfw-provider/sfw-provider-requests/Cargo.lock index de92d696c4..a6ad35debe 100644 --- a/sfw-provider/sfw-provider-requests/Cargo.lock +++ b/sfw-provider/sfw-provider-requests/Cargo.lock @@ -351,7 +351,6 @@ dependencies = [ "aes-ctr 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "blake2 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", - "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "chacha 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "curve25519-dalek 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "hkdf 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",