check for error when getting the slot

This commit is contained in:
Kirill Lykov 2023-04-04 11:15:09 +00:00
parent 3fa5aa0930
commit 9dd81888a2
1 changed files with 6 additions and 3 deletions

View File

@ -103,9 +103,12 @@ pub async fn poll_blockhash_and_slot(
break;
}
let new_slot = client.get_slot().unwrap();
{
slot.store(new_slot, Ordering::Release);
match client.get_slot() {
Ok(new_slot) => slot.store(new_slot, Ordering::Release),
Err(e) => {
info!("Failed to download slot: {}, skip", e);
continue;
}
}
if let Some(new_blockhash) = get_new_latest_blockhash(client, &old_blockhash).await {