diff --git a/src/requests.rs b/src/requests.rs index 83580eb..b60c6e6 100644 --- a/src/requests.rs +++ b/src/requests.rs @@ -151,7 +151,9 @@ pub async fn get_status(dashboard: Arc>) -> Result<(), anyhow:: let mut data = dashboard.lock().unwrap(); if resp2 != Value::Null { - data.kernel_mmr_size = resp2["result"]["Ok"]["header"]["kernel_mmr_size"].to_string(); + if resp2["result"]["Ok"]["header"]["kernel_mmr_size"] != Value::Null { + data.kernel_mmr_size = resp2["result"]["Ok"]["header"]["kernel_mmr_size"].to_string(); + } } if resp1["result"]["Ok"]["chain"] == Value::Null { diff --git a/src/worker.rs b/src/worker.rs index 75ab5d2..daf629b 100644 --- a/src/worker.rs +++ b/src/worker.rs @@ -47,8 +47,10 @@ pub async fn stats(dash: Arc>, txns: Arc>, stats.fees.push(txns.fees_24h.clone()); stats.utxo_count.push(dash.utxo_count.clone()); - let kernel_count = dash.kernel_mmr_size.parse::().unwrap() / 2; - stats.kernels.push(kernel_count.to_string()); + if dash.kernel_mmr_size.is_empty() == false { + let kernel_count = dash.kernel_mmr_size.parse::().unwrap() / 2; + stats.kernels.push(kernel_count.to_string()); + } Ok(()) }