mirror of
https://github.com/transatoshi-mw/grin-explorer.git
synced 2025-10-21 21:43:40 +00:00
Adjust hashrate metrics for testnet
This commit is contained in:
@@ -314,7 +314,7 @@ fn disk_usage(dashboard: &State<Arc<Mutex<Dashboard>>>) -> String {
|
|||||||
fn network_hashrate(dashboard: &State<Arc<Mutex<Dashboard>>>) -> String {
|
fn network_hashrate(dashboard: &State<Arc<Mutex<Dashboard>>>) -> String {
|
||||||
let data = dashboard.lock().unwrap();
|
let data = dashboard.lock().unwrap();
|
||||||
|
|
||||||
format!("{} KG/s", data.hashrate)
|
data.hashrate.clone()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -240,8 +240,16 @@ pub async fn get_mining_stats(dashboard: Arc<Mutex<Dashboard>>) -> Result<(), an
|
|||||||
|
|
||||||
// https://forum.grin.mw/t/on-dual-pow-graph-rates-gps-and-difficulty/2144/52
|
// https://forum.grin.mw/t/on-dual-pow-graph-rates-gps-and-difficulty/2144/52
|
||||||
// https://forum.grin.mw/t/difference-c31-and-c32-c33/7018/7
|
// https://forum.grin.mw/t/difference-c31-and-c32-c33/7018/7
|
||||||
let hashrate = (net_diff as f64) * 42.0 / 60.0 / 16384.0;
|
let hashrate = (net_diff as f64) * 42.0 / 60.0 / 16384.0;
|
||||||
data.hashrate = format!("{:.2}", hashrate / 1000.0);
|
|
||||||
|
// KG/s
|
||||||
|
if hashrate > 1000.0 {
|
||||||
|
data.hashrate = format!("{:.2} KG/s", hashrate / 1000.0);
|
||||||
|
// G/s
|
||||||
|
} else {
|
||||||
|
data.hashrate = format!("{:.2} G/s", hashrate);
|
||||||
|
}
|
||||||
|
|
||||||
data.difficulty = net_diff.to_string();
|
data.difficulty = net_diff.to_string();
|
||||||
|
|
||||||
if CONFIG.coingecko_api == "on" {
|
if CONFIG.coingecko_api == "on" {
|
||||||
|
Reference in New Issue
Block a user