Skip to content

Commit

Permalink
fix: advanced XvB: manual XvB and P2Pool HR don't use proxy values wh…
Browse files Browse the repository at this point in the history
…en possible
  • Loading branch information
Cyrix126 committed Nov 12, 2024
1 parent c80c6f8 commit 068b11a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/app/panels/middle/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
});
Expand Down
8 changes: 6 additions & 2 deletions src/app/panels/middle/xvb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -38,6 +39,7 @@ impl crate::disk::state::Xvb {
ui: &mut egui::Ui,
api: &Arc<Mutex<PubXvbApi>>,
gui_api_xmrig: &Arc<Mutex<PubXmrigApi>>,
gui_api_xp: &Arc<Mutex<PubXmrigProxyApi>>,
is_alive: bool,
) {
egui::ScrollArea::vertical().show(ui, |ui| {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 068b11a

Please sign in to comment.