From d1bb7377afe25f674df4252a47b14e50b931c55f Mon Sep 17 00:00:00 2001 From: Martin Stefcek <35243812+Cifko@users.noreply.github.com> Date: Mon, 30 Aug 2021 17:14:07 +0200 Subject: [PATCH] fix: small display bug (#3257) Description --- The escape sequence was eating up the string "Starting recovery at height: ". How Has This Been Tested? --- Manually/visually. --- 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(()) }