mirror of
https://github.com/Cyrix126/gupaxx.git
synced 2024-11-16 15:27:46 +00:00
fix: clippy
This commit is contained in:
parent
e0d8b1efde
commit
8f669aa105
2 changed files with 35 additions and 38 deletions
|
@ -5,7 +5,7 @@ mod test {
|
|||
use crate::helper::xvb::algorithm::Algorithm;
|
||||
use crate::helper::{
|
||||
p2pool::{PrivP2poolLocalApi, PrivP2poolNetworkApi},
|
||||
xvb::{priv_stats::RuntimeDonationLevel, priv_stats::RuntimeMode, rounds::round_type},
|
||||
xvb::{priv_stats::RuntimeDonationLevel, priv_stats::RuntimeMode},
|
||||
Helper, Process, ProcessName, ProcessState,
|
||||
};
|
||||
|
||||
|
@ -511,9 +511,8 @@ Uptime = 0h 2m 4s
|
|||
|
||||
use crate::{
|
||||
disk::state::P2pool,
|
||||
helper::{p2pool::PubP2poolApi, xrig::xmrig::PubXmrigApi, xvb::rounds::XvbRound},
|
||||
helper::{p2pool::PubP2poolApi, xrig::xmrig::PubXmrigApi},
|
||||
macros::lock,
|
||||
XVB_TIME_ALGO,
|
||||
};
|
||||
|
||||
use crate::helper::xvb::{public_stats::XvbPubStats, PubXvbApi};
|
||||
|
|
|
@ -782,43 +782,41 @@ fn signal_interrupt(
|
|||
// can update xmrig and check status of state in the same time.
|
||||
// Need to set XMRig to P2Pool if it wasn't. XMRig should have populated this value at his start.
|
||||
// but if xmrig didn't start, don't update it.
|
||||
if lock!(process_xrig).state == ProcessState::Alive {
|
||||
if lock!(gui_api).current_node != Some(XvbNode::P2pool) {
|
||||
spawn(enc!((client, token_xmrig, address, gui_api_xmrig, gui_api_xp, gui_api) async move{
|
||||
let url_api = api_url_xmrig(xp_alive, true);
|
||||
warn!("update xmrig to use node ?");
|
||||
if let Err(err) = update_xmrig_config(
|
||||
&client,
|
||||
&url_api,
|
||||
&token_xmrig,
|
||||
&XvbNode::P2pool,
|
||||
&address,
|
||||
&rig
|
||||
)
|
||||
.await {
|
||||
let msg_xmrig_or_proxy = if xp_alive {
|
||||
"XMRig-Proxy"
|
||||
} else {
|
||||
"XMRig"
|
||||
};
|
||||
output_console(
|
||||
&mut lock!(gui_api).output,
|
||||
&format!(
|
||||
"Failure to update {msg_xmrig_or_proxy} config with HTTP API.\nError: {}",
|
||||
err
|
||||
), ProcessName::Xvb
|
||||
);
|
||||
if lock!(process_xrig).state == ProcessState::Alive && lock!(gui_api).current_node != Some(XvbNode::P2pool) {
|
||||
spawn(enc!((client, token_xmrig, address, gui_api_xmrig, gui_api_xp, gui_api) async move{
|
||||
let url_api = api_url_xmrig(xp_alive, true);
|
||||
warn!("update xmrig to use node ?");
|
||||
if let Err(err) = update_xmrig_config(
|
||||
&client,
|
||||
&url_api,
|
||||
&token_xmrig,
|
||||
&XvbNode::P2pool,
|
||||
&address,
|
||||
&rig
|
||||
)
|
||||
.await {
|
||||
let msg_xmrig_or_proxy = if xp_alive {
|
||||
"XMRig-Proxy"
|
||||
} else {
|
||||
// update node xmrig
|
||||
if xp_alive {
|
||||
lock!(gui_api_xp).node = XvbNode::P2pool.to_string();
|
||||
} else {
|
||||
lock!(gui_api_xmrig).node = XvbNode::P2pool.to_string();
|
||||
};
|
||||
}
|
||||
"XMRig"
|
||||
};
|
||||
output_console(
|
||||
&mut lock!(gui_api).output,
|
||||
&format!(
|
||||
"Failure to update {msg_xmrig_or_proxy} config with HTTP API.\nError: {}",
|
||||
err
|
||||
), ProcessName::Xvb
|
||||
);
|
||||
} else {
|
||||
// update node xmrig
|
||||
if xp_alive {
|
||||
lock!(gui_api_xp).node = XvbNode::P2pool.to_string();
|
||||
} else {
|
||||
lock!(gui_api_xmrig).node = XvbNode::P2pool.to_string();
|
||||
};
|
||||
}
|
||||
));}
|
||||
}
|
||||
}
|
||||
));}
|
||||
},
|
||||
_ => {}
|
||||
} } ),
|
||||
|
|
Loading…
Reference in a new issue