fixing InvalidDigit error

This commit is contained in:
aglkm
2025-03-20 02:28:40 +03:00
parent 37f6407292
commit aafa8ca815

View File

@@ -279,7 +279,9 @@ pub async fn get_mining_stats(dashboard: Arc<Mutex<Dashboard>>) -> Result<(), an
let mut data = dashboard.lock().unwrap(); let mut data = dashboard.lock().unwrap();
if resp1 != Value::Null && resp2 != Value::Null { if resp1 != Value::Null && resp2 != Value::Null &&
resp1["result"]["Ok"].is_null() == false &&
resp2["result"]["Ok"].is_null() == false {
// Calculate network difficulty // Calculate network difficulty
let net_diff = (resp1["result"]["Ok"]["header"]["total_difficulty"] let net_diff = (resp1["result"]["Ok"]["header"]["total_difficulty"]
.to_string().parse::<u64>().unwrap() .to_string().parse::<u64>().unwrap()
@@ -319,6 +321,10 @@ pub async fn get_mining_stats(dashboard: Arc<Mutex<Dashboard>>) -> Result<(), an
/ (120.0 / 1000.0 * (1.0 / coins_per_hour))); / (120.0 / 1000.0 * (1.0 / coins_per_hour)));
} }
} }
} else {
error!("get_mining_stats() failed");
error!("RPC response 1: {:?}", resp1);
error!("RPC response 2: {:?}", resp2);
} }
} }