Skip to content

Commit

Permalink
Handle block count RPC error gracefully (#1637)
Browse files Browse the repository at this point in the history
Co-authored-by: raphjaph <raphjaph@protonmail.com>
  • Loading branch information
andrewtoth and raphjaph authored Feb 21, 2023
1 parent 9f46f08 commit 63b57ad
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/index/updater.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,11 @@ impl Updater {
progress_bar.inc(1);

if progress_bar.position() > progress_bar.length().unwrap() {
progress_bar.set_length(index.client.get_block_count()? + 1);
if let Ok(count) = index.client.get_block_count() {
progress_bar.set_length(count + 1);
} else {
log::warn!("Failed to fetch latest block height");
}
}
}

Expand Down

0 comments on commit 63b57ad

Please sign in to comment.