From c4d1eda590888e10835fd9ced11e692dd211c041 Mon Sep 17 00:00:00 2001 From: Louis-Marie Baer Date: Wed, 24 Jul 2024 20:49:49 +0200 Subject: [PATCH] fix: log process name and sending update node to XvB when p2pool is the faulty one. --- src/helper/xrig/xmrig.rs | 6 +++++- src/helper/xrig/xmrig_proxy.rs | 12 +++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/helper/xrig/xmrig.rs b/src/helper/xrig/xmrig.rs index 078df8e..d53ac6e 100644 --- a/src/helper/xrig/xmrig.rs +++ b/src/helper/xrig/xmrig.rs @@ -70,7 +70,11 @@ impl Helper { // updating current node to None, will stop sending signal of FailedNode until new node is set // send signal to update node. warn!("XMRig PTY Parse | node is offline, sending signal to update nodes."); - lock!(process_xvb).signal = ProcessSignal::UpdateNodes(current_node); + // update nodes only if we were not mining on p2pool. + // if xmrig stop, xvb will react in any case. + if current_node != XvbNode::P2pool { + lock!(process_xvb).signal = ProcessSignal::UpdateNodes(current_node); + } lock!(pub_api_xvb).current_node = None; } } diff --git a/src/helper/xrig/xmrig_proxy.rs b/src/helper/xrig/xmrig_proxy.rs index a8856e5..c427009 100644 --- a/src/helper/xrig/xmrig_proxy.rs +++ b/src/helper/xrig/xmrig_proxy.rs @@ -72,7 +72,9 @@ impl Helper { warn!( "XMRig-Proxy PTY Parse | node is offline, sending signal to update nodes." ); - lock!(process_xvb).signal = ProcessSignal::UpdateNodes(current_node); + if current_node != XvbNode::P2pool { + lock!(process_xvb).signal = ProcessSignal::UpdateNodes(current_node); + } lock!(pub_api_xvb).current_node = None; } } @@ -212,7 +214,7 @@ impl Helper { state_xmrig: &Xmrig, path: &Path, ) { - info!("XMRig | Attempting to restart..."); + info!("XMRig-Proxy | Attempting to restart..."); lock2!(helper, xmrig_proxy).state = ProcessState::Middle; lock2!(helper, xmrig_proxy).signal = ProcessSignal::Restart; @@ -227,10 +229,10 @@ impl Helper { sleep!(1000); } // Ok, process is not alive, start the new one! - info!("XMRig_proxy | Old process seems dead, starting new one!"); + info!("XMRig-Proxy | Old process seems dead, starting new one!"); Self::start_xp(&helper, &state, &state_xmrig, &path); }); - info!("XMRig | Restart ... OK"); + info!("XMRig-Proxy | Restart ... OK"); } pub fn start_xp( helper: &Arc>, @@ -354,7 +356,7 @@ impl Helper { if let Err(e) = writeln!(stdin, "c") { error!("P2Pool Watchdog | STDIN error: {}", e); } - info!("XMRig | Entering watchdog mode... woof!"); + info!("XMRig-Proxy | Entering watchdog mode... woof!"); loop { let now = Instant::now(); debug!("XMRig-Proxy Watchdog | ----------- Start of loop -----------");