diff --git a/src/helper/xmrig.rs b/src/helper/xmrig.rs index fc23336..0aeb697 100644 --- a/src/helper/xmrig.rs +++ b/src/helper/xmrig.rs @@ -826,6 +826,7 @@ impl PrivXmrigApi { node: &XvbNode, address: &str, pub_api_xmrig: &Arc>, + rig: &str, ) -> Result<()> { // get config let request = client @@ -843,6 +844,9 @@ impl PrivXmrigApi { .ok_or_else(|| anyhow!("pools/0/user does not exist in xmrig config"))? = node .user(&address.chars().take(8).collect::()) .into(); + *config + .pointer_mut("/pools/0/rig-id") + .ok_or_else(|| anyhow!("pools/0/rig-id does not exist in xmrig config"))? = rig.into(); *config .pointer_mut("/pools/0/tls") .ok_or_else(|| anyhow!("pools/0/tls does not exist in xmrig config"))? = diff --git a/src/helper/xvb/algorithm.rs b/src/helper/xvb/algorithm.rs index 62581b6..e0dcf33 100644 --- a/src/helper/xvb/algorithm.rs +++ b/src/helper/xvb/algorithm.rs @@ -173,6 +173,7 @@ async fn sleep_then_update_node_xmrig( address: &str, gui_api_xvb: &Arc>, gui_api_xmrig: &Arc>, + rig: &str, ) { let node = lock!(gui_api_xvb).stats_priv.node; debug!( @@ -196,6 +197,7 @@ async fn sleep_then_update_node_xmrig( &node, address, gui_api_xmrig, + rig, ) .await { @@ -231,6 +233,7 @@ pub(crate) async fn algorithm( state_p2pool: &crate::disk::state::P2pool, share: u32, time_donated: &Arc>, + rig: &str, ) { debug!("Xvb Process | Algorithm is started"); output_console( @@ -282,6 +285,7 @@ pub(crate) async fn algorithm( &XvbNode::P2pool, address, gui_api_xmrig, + rig, ) .await { @@ -305,6 +309,7 @@ pub(crate) async fn algorithm( address, gui_api_xvb, gui_api_xmrig, + "", ) .await; lock!(gui_api_xvb) @@ -330,6 +335,7 @@ pub(crate) async fn algorithm( &XvbNode::P2pool, address, gui_api_xmrig, + rig, ) .await { diff --git a/src/helper/xvb/mod.rs b/src/helper/xvb/mod.rs index a74f6cd..8632d2c 100644 --- a/src/helper/xvb/mod.rs +++ b/src/helper/xvb/mod.rs @@ -300,6 +300,7 @@ impl Helper { &state_p2pool, share, &time_donated, + &state_xmrig.rig, ).await; }))); } else { @@ -501,6 +502,7 @@ async fn check_state_outcauses_xvb( { let token_xmrig = state_xmrig.token.clone(); let address = state_p2pool.address.clone(); + let rig = state_xmrig.rig.clone(); spawn(enc!((client, pub_api_xmrig, gui_api) async move { if let Err(err) = PrivXmrigApi::update_xmrig_config( @@ -510,6 +512,7 @@ async fn check_state_outcauses_xvb( &XvbNode::P2pool, &address, &pub_api_xmrig, + &rig ) .await { @@ -618,6 +621,7 @@ fn signal_interrupt( ProcessSignal::UpdateNodes(node) => { if lock!(process).state != ProcessState::Waiting { let token_xmrig = state_xmrig.token.clone(); + let rig = state_xmrig.rig.clone(); let address = state_p2pool.address.clone(); // check if state is alive. If it is and it is receiving such a signal, it means something a node (XvB or P2Pool) has failed. // if XvB, xmrig needs to be switch to the other node (both will be checked though to be sure). @@ -664,6 +668,7 @@ fn signal_interrupt( &XvbNode::P2pool, &address, &gui_api_xmrig, + &rig ) .await { output_console(