From bfaee9577f750d1e11472a114ad16c5a5a9885f8 Mon Sep 17 00:00:00 2001 From: Martin Stefcek Date: Sat, 28 Aug 2021 12:27:35 +0200 Subject: [PATCH] fix: small display bug --- applications/tari_base_node/src/recovery.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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(()) }