xmrig: fix node [Save] not change selected values

This commit is contained in:
hinto-janaiyo 2022-12-08 22:37:50 -05:00
parent 6dbf0386c4
commit 965e070ff5
No known key found for this signature in database
GPG key ID: B1C5A64B80691E45
2 changed files with 7 additions and 3 deletions

View file

@ -556,7 +556,7 @@ impl Helper {
// //
// Just sets some signals for the watchdog thread to pick up on. // Just sets some signals for the watchdog thread to pick up on.
pub fn stop_xmrig(helper: &Arc<Mutex<Self>>) { pub fn stop_xmrig(helper: &Arc<Mutex<Self>>) {
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().signal = ProcessSignal::Stop;
helper.lock().unwrap().xmrig.lock().unwrap().state = ProcessState::Middle; helper.lock().unwrap().xmrig.lock().unwrap().state = ProcessState::Middle;
} }
@ -656,8 +656,8 @@ impl Helper {
// Else, build the argument // Else, build the argument
} else { } 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_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 api_port = if state.api_port.is_empty() { "18088" } else { &state.api_port };
let url = format!("{}:{}", api_ip, api_port); // Combine IP:Port into one string 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("--user".to_string()); args.push(state.address.clone()); // Wallet
args.push("--threads".to_string()); args.push(state.current_threads.to_string()); // Threads 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 args.push("--rig-id".to_string()); args.push(state.selected_rig.to_string()); // Rig ID

View file

@ -278,6 +278,10 @@ impl Xmrig {
port: self.port.clone(), port: self.port.clone(),
}; };
pool_vec[existing_index].1 = pool; 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); info!("Node | S | [index: {}, name: \"{}\", ip: \"{}\", port: {}, rig: \"{}\"]", existing_index+1, self.name, self.ip, self.port, self.rig);
} }
// Else, add to the list // Else, add to the list