mirror of
https://github.com/transatoshi-mw/grin-explorer.git
synced 2025-10-21 21:43:40 +00:00
another panick fix on startup if node is not fully synced
This commit is contained in:
@@ -783,6 +783,7 @@ pub async fn get_unspent_outputs(dashboard: Arc<Mutex<Dashboard>>) -> Result<(),
|
|||||||
let resp = call("get_unspent_outputs", params, "1", "foreign").await?;
|
let resp = call("get_unspent_outputs", params, "1", "foreign").await?;
|
||||||
|
|
||||||
if resp != Value::Null {
|
if resp != Value::Null {
|
||||||
|
if resp["result"]["Ok"]["outputs"] != Value::Null {
|
||||||
if let Some(v) = resp["result"]["Ok"]["outputs"].as_array().unwrap().last() {
|
if let Some(v) = resp["result"]["Ok"]["outputs"].as_array().unwrap().last() {
|
||||||
current_mmr_index = v["mmr_index"].to_string().parse::<u64>().unwrap();
|
current_mmr_index = v["mmr_index"].to_string().parse::<u64>().unwrap();
|
||||||
utxo_count = utxo_count + resp["result"]["Ok"]["outputs"].as_array().unwrap().len();
|
utxo_count = utxo_count + resp["result"]["Ok"]["outputs"].as_array().unwrap().len();
|
||||||
@@ -792,6 +793,7 @@ pub async fn get_unspent_outputs(dashboard: Arc<Mutex<Dashboard>>) -> Result<(),
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let mut data = dashboard.lock().unwrap();
|
let mut data = dashboard.lock().unwrap();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user