diff --git a/applications/tari_base_node/src/recovery.rs b/applications/tari_base_node/src/recovery.rs index ce62fe36a3..2ea5317bac 100644 --- a/applications/tari_base_node/src/recovery.rs +++ b/applications/tari_base_node/src/recovery.rs @@ -173,12 +173,12 @@ async fn do_recovery( db.add_block(Arc::new(block)) .await .map_err(|e| anyhow!("Stopped recovery at height {}, reason: {}", counter, e))?; - counter += 1; - if counter > max_height { - info!(target: LOG_TARGET, "Done with recovery, chain height {}", counter - 1); + if counter >= max_height { + info!(target: LOG_TARGET, "Done with recovery, chain height {}", counter); break; } - print!("\x1B[{}D\x1B[K", (counter + 1).to_string().chars().count()); + print!("\x1B[{}D\x1B[K", counter.to_string().len()); + counter += 1; } Ok(()) }