diff --git a/Cargo.lock b/Cargo.lock index 9dfd279170..188850e8e5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5060,7 +5060,7 @@ dependencies = [ [[package]] name = "tari_wallet_ffi" -version = "0.17.3" +version = "0.17.4" dependencies = [ "chrono", "env_logger 0.7.1", diff --git a/applications/tari_base_node/src/main.rs b/applications/tari_base_node/src/main.rs index 5b51179c4a..bd66eb2544 100644 --- a/applications/tari_base_node/src/main.rs +++ b/applications/tari_base_node/src/main.rs @@ -264,7 +264,7 @@ async fn run_grpc( } async fn read_command(mut rustyline: Editor) -> Result<(String, Editor), String> { - task::spawn(async { + task::spawn_blocking(|| { let readline = rustyline.readline(">> "); match readline { @@ -330,9 +330,11 @@ async fn cli_loop(parser: Parser, mut shutdown: Shutdown) { match res { Ok((line, mut rustyline)) => { if let Some(p) = rustyline.helper_mut().as_deref_mut() { - p.handle_command(line.as_str(), &mut shutdown) + p.handle_command(line.as_str(), &mut shutdown); + } + if !shutdown.is_triggered() { + read_command_fut.set(read_command(rustyline).fuse()); } - read_command_fut.set(read_command(rustyline).fuse()); }, Err(err) => { // This happens when the node is shutting down.