Skip to content

Commit

Permalink
fix: update to new p2pool
Browse files Browse the repository at this point in the history
  • Loading branch information
stringhandler committed Oct 16, 2024
1 parent 74fd17c commit dcd3780
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion src-tauri/binaries_versions_esmeralda.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"mmproxy": "=1.7.0-pre.2",
"minotari_node": "=1.7.0-pre.2",
"wallet": "=1.7.0-pre.2",
"sha-p2pool": "=0.3.0",
"sha-p2pool": "=0.3.3",
"xtrgpuminer": "=0.1.16",
"tor": "=13.5.6"
}
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/binaries_versions_nextnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"mmproxy": "=1.7.0-rc.2",
"minotari_node": "=1.7.0-rc.2",
"wallet": "=1.7.0-rc.2",
"sha-p2pool": "=0.3.0",
"sha-p2pool": "=0.3.3",
"xtrgpuminer": "=0.1.16",
"tor": "=13.5.6"
}
Expand Down
40 changes: 20 additions & 20 deletions src-tauri/src/mm_proxy_adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,35 +156,35 @@ pub struct MergeMiningProxyStatusMonitor {
#[async_trait]
impl StatusMonitor for MergeMiningProxyStatusMonitor {
async fn check_health(&self) -> HealthStatus {
let monero_donate_address = "44AFFq5kSiGBoZ4NMDwYtN18obc8AemS33DBLWs3H7otXft3XjrpDtQGv7SqSsaBYBb98uNbr2VBBEt7f2wfn3RVGQBEP3A";

if self
.get_block_template(monero_donate_address)
.await
.inspect_err(|e| warn!(target: LOG_TARGET, "Failed to get block template during health check: {:?}", e))
.is_ok()
{
HealthStatus::Healthy
} else {
if self.start_time.elapsed().as_secs() < 10 {
return HealthStatus::Healthy;
}
// HealthStatus::Unhealthy
// This can return a bad error from time to time, especially on startup
HealthStatus::Warning
}
// TODO: Monero calls are really slow, so temporarily changing to Healthy
HealthStatus::Healthy
// if self
// .get_version()
// .await
// .inspect_err(|e| warn!(target: LOG_TARGET, "Failed to get block template during health check: {:?}", e))
// .is_ok()
// {
// HealthStatus::Healthy
// } else {
// if self.start_time.elapsed().as_secs() < 10 {
// return HealthStatus::Healthy;
// }
// // HealthStatus::Unhealthy
// // This can return a bad error from time to time, especially on startup
// HealthStatus::Warning
// }
}
}

impl MergeMiningProxyStatusMonitor {
pub async fn get_block_template(&self, monero_address: &str) -> Result<String, Error> {
#[allow(dead_code)]
pub async fn get_version(&self) -> Result<String, Error> {
let rpc_url = format!("http://127.0.0.1:{}/json_rpc", self.json_rpc_port);
let request_body = json!({
"jsonrpc": "2.0",
"id": "0",
"method": "get_block_template",
"method": "get_version",
"params": {
"wallet_address": monero_address,
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const LowHashRateWarning = () => {
const { t } = useTranslation('settings', { useSuspense: false });
const { hash_rate, is_mining } = useMiningStore((s) => s.cpu.mining);

const showHashRateWarning = is_mining && hash_rate > 0 && hash_rate < 250;
const showHashRateWarning = is_mining && hash_rate > 0 && hash_rate < 100;

return showHashRateWarning ? (
<Stack direction="row" justifyContent="space-between" alignItems="center">
Expand Down

0 comments on commit dcd3780

Please sign in to comment.