mirror of
https://github.com/transatoshi-mw/grin-explorer.git
synced 2025-10-21 13:33:41 +00:00
fix panick on startup if node is not fully synced
This commit is contained in:
@@ -151,8 +151,10 @@ pub async fn get_status(dashboard: Arc<Mutex<Dashboard>>) -> Result<(), anyhow::
|
||||
let mut data = dashboard.lock().unwrap();
|
||||
|
||||
if resp2 != Value::Null {
|
||||
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 {
|
||||
if data.chain.is_empty() {
|
||||
|
@@ -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());
|
||||
|
||||
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(())
|
||||
}
|
||||
|
Reference in New Issue
Block a user