fix panick on startup if node is not fully synced

This commit is contained in:
aglkm
2024-10-29 17:16:53 +03:00
parent 94d8a26081
commit 21ed028ade
2 changed files with 7 additions and 3 deletions

View File

@@ -47,8 +47,10 @@ pub async fn stats(dash: Arc<Mutex<Dashboard>>, txns: Arc<Mutex<Transactions>>,
stats.fees.push(txns.fees_24h.clone());
stats.utxo_count.push(dash.utxo_count.clone());
let kernel_count = dash.kernel_mmr_size.parse::<u64>().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::<u64>().unwrap() / 2;
stats.kernels.push(kernel_count.to_string());
}
Ok(())
}