From 965e070ff52fbcc6d913b8deb9ff69a43c3d68a2 Mon Sep 17 00:00:00 2001 From: hinto-janaiyo Date: Thu, 8 Dec 2022 22:37:50 -0500 Subject: [PATCH] xmrig: fix node [Save] not change selected values --- src/helper.rs | 6 +++--- src/xmrig.rs | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/helper.rs b/src/helper.rs index c4e4a82..3cffcdb 100644 --- a/src/helper.rs +++ b/src/helper.rs @@ -556,7 +556,7 @@ impl Helper { // // Just sets some signals for the watchdog thread to pick up on. pub fn stop_xmrig(helper: &Arc>) { - info!("P2Pool | Attempting to stop..."); + info!("XMRig | Attempting to stop..."); helper.lock().unwrap().xmrig.lock().unwrap().signal = ProcessSignal::Stop; helper.lock().unwrap().xmrig.lock().unwrap().state = ProcessState::Middle; } @@ -656,8 +656,8 @@ impl Helper { // Else, build the argument } else { let api_ip = if state.api_ip == "localhost" || state.api_ip.is_empty() { "127.0.0.1" } else { &state.api_ip }; // XMRig doesn't understand [localhost] - let api_port = if state.selected_port.is_empty() { "18088" } else { &state.selected_port }; - let url = format!("{}:{}", api_ip, api_port); // Combine IP:Port into one string + let api_port = if state.api_port.is_empty() { "18088" } else { &state.api_port }; + let url = format!("{}:{}", state.selected_ip, state.selected_port); // Combine IP:Port into one string args.push("--user".to_string()); args.push(state.address.clone()); // Wallet args.push("--threads".to_string()); args.push(state.current_threads.to_string()); // Threads args.push("--rig-id".to_string()); args.push(state.selected_rig.to_string()); // Rig ID diff --git a/src/xmrig.rs b/src/xmrig.rs index 227cbe1..32eb621 100644 --- a/src/xmrig.rs +++ b/src/xmrig.rs @@ -278,6 +278,10 @@ impl Xmrig { port: self.port.clone(), }; pool_vec[existing_index].1 = pool; + self.selected_name = self.name.clone(); + self.selected_rig = self.rig.clone(); + self.selected_ip = self.ip.clone(); + self.selected_port = self.port.clone(); info!("Node | S | [index: {}, name: \"{}\", ip: \"{}\", port: {}, rig: \"{}\"]", existing_index+1, self.name, self.ip, self.port, self.rig); } // Else, add to the list