From 068b11aface1b302237838816c7c7b1318f250ce Mon Sep 17 00:00:00 2001 From: Cyrix126 Date: Tue, 12 Nov 2024 12:09:43 +0100 Subject: [PATCH] fix: advanced XvB: manual XvB and P2Pool HR don't use proxy values when possible --- src/app/panels/middle/mod.rs | 2 +- src/app/panels/middle/xvb.rs | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/app/panels/middle/mod.rs b/src/app/panels/middle/mod.rs index c318849..d05de00 100644 --- a/src/app/panels/middle/mod.rs +++ b/src/app/panels/middle/mod.rs @@ -184,7 +184,7 @@ path_xmr: {:#?}\n } Tab::Xvb => { debug!("App | Entering [XvB] Tab"); - crate::disk::state::Xvb::show(&mut self.state.xvb, self.size, &self.state.p2pool.address, ctx, ui, &self.xvb_api, &self.xmrig_api, xvb_is_running); + crate::disk::state::Xvb::show(&mut self.state.xvb, self.size, &self.state.p2pool.address, ctx, ui, &self.xvb_api, &self.xmrig_api, &self.xmrig_proxy_api, xvb_is_running); } } }); diff --git a/src/app/panels/middle/xvb.rs b/src/app/panels/middle/xvb.rs index 5180b1b..7f85204 100644 --- a/src/app/panels/middle/xvb.rs +++ b/src/app/panels/middle/xvb.rs @@ -8,6 +8,7 @@ use readable::up::Uptime; use crate::disk::state::{ManualDonationLevel, ManualDonationMetric, XvbMode}; use crate::helper::xrig::xmrig::PubXmrigApi; +use crate::helper::xrig::xmrig_proxy::PubXmrigProxyApi; use crate::helper::xvb::priv_stats::RuntimeMode; use crate::helper::xvb::PubXvbApi; use crate::regex::num_lines; @@ -38,6 +39,7 @@ impl crate::disk::state::Xvb { ui: &mut egui::Ui, api: &Arc>, gui_api_xmrig: &Arc>, + gui_api_xp: &Arc>, is_alive: bool, ) { egui::ScrollArea::vertical().show(ui, |ui| { @@ -174,9 +176,11 @@ impl crate::disk::state::Xvb { ManualDonationMetric::Kilo => 1_000_000.0, ManualDonationMetric::Mega => 1_000_000_000.0 }; - + // use proxy HR in priority, or use xmrig or default. let mut hashrate_xmrig = { - if gui_api_xmrig.lock().unwrap().hashrate_raw_15m > 0.0 { + if gui_api_xp.lock().unwrap().hashrate_10m > 0.0 { + gui_api_xp.lock().unwrap().hashrate_10m + } else if gui_api_xmrig.lock().unwrap().hashrate_raw_15m > 0.0 { gui_api_xmrig.lock().unwrap().hashrate_raw_15m } else if gui_api_xmrig.lock().unwrap().hashrate_raw_1m > 0.0 { gui_api_xmrig.lock().unwrap().hashrate_raw_1m