diff --git a/src/helper/xrig/mod.rs b/src/helper/xrig/mod.rs index 9121034..d16ad9d 100644 --- a/src/helper/xrig/mod.rs +++ b/src/helper/xrig/mod.rs @@ -27,7 +27,10 @@ pub async fn update_xmrig_config( let mut config = request.send().await?.json::().await?; // modify node configuration let uri = [node.url(), ":".to_string(), node.port()].concat(); - info!("replace xmrig config with node {}", uri); + info!( + "replace xmrig from api url {api_uri} config with node {}", + uri + ); *config .pointer_mut("/pools/0/url") .ok_or_else(|| anyhow!("pools/0/url does not exist in xmrig config"))? = uri.into(); diff --git a/src/helper/xvb/algorithm.rs b/src/helper/xvb/algorithm.rs index 3c8e37d..492e5f0 100644 --- a/src/helper/xvb/algorithm.rs +++ b/src/helper/xvb/algorithm.rs @@ -91,6 +91,7 @@ struct Stats { spareable_hashrate: f32, spared_time: u32, api_url: String, + msg_xmrig_or_xp: &str, } impl<'a> Algorithm<'a> { @@ -140,6 +141,9 @@ impl<'a> Algorithm<'a> { let api_url = api_url_xmrig(xp_alive, true); + let msg_xmrig_or_xp = if xp_alive { "XMRig-Proxy" } else { "XMRig" }; + info!("xp alive: {:?}", xp_alive); + // TODO consider printing algorithm stats instead of spreadout print statements let stats = Stats { share, @@ -158,6 +162,7 @@ impl<'a> Algorithm<'a> { spareable_hashrate, spared_time: u32::default(), api_url, + msg_xmrig_or_xp, }; let mut new_instace = Self { @@ -232,11 +237,6 @@ impl<'a> Algorithm<'a> { } async fn target_xvb_node(&self) { - let msg_xmrig_or_xp = if self.xp_alive { - "XMRig-Proxy" - } else { - "XMRig" - }; let node = lock!(self.gui_api_xvb).stats_priv.node; debug!("Xvb Process | request {msg_xmrig_or_xp} to mine on XvB"); diff --git a/src/helper/xvb/mod.rs b/src/helper/xvb/mod.rs index 688bc7f..e9f4b71 100644 --- a/src/helper/xvb/mod.rs +++ b/src/helper/xvb/mod.rs @@ -836,8 +836,10 @@ fn update_indicator_algo( ); lock!(pub_api).stats_priv.time_switch_node = XVB_TIME_ALGO - - last_algorithm.lock().unwrap().elapsed().as_secs() as u32 - - time_donated; + .checked_sub(last_algorithm.lock().unwrap().elapsed().as_secs() as u32) + .unwrap_or_default() + .checked_sub(time_donated) + .unwrap_or_default(); "time until switch to mining on XvB".to_string() } _ => {