From 0ad61e6481b4d88e9990f69df47807655a8ea263 Mon Sep 17 00:00:00 2001 From: hrxi Date: Fri, 28 Jun 2024 10:11:55 +0200 Subject: [PATCH] `std::env:set_var` is unsafe and should be avoided https://doc.rust-lang.org/std/env/fn.set_var.html --- pow-migration/src/lib.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pow-migration/src/lib.rs b/pow-migration/src/lib.rs index 40dc44cee2..d1df850d32 100644 --- a/pow-migration/src/lib.rs +++ b/pow-migration/src/lib.rs @@ -418,19 +418,16 @@ pub fn launch_pos_client( config_file: &str, genesis_env_var_name: &str, ) -> Result { - // Start the nimiq PoS client with the generated genesis file log::info!( filename = ?genesis_file, "Launching PoS client with generated genesis" ); - // Set the genesis file environment variable - std::env::set_var(genesis_env_var_name, genesis_file); - // Launch the PoS client let mut child = match Command::new(pos_client_path) .arg("-c") .arg(config_file) + .env(genesis_env_var_name, genesis_file) .spawn() { Ok(child) => child,