Show recovery progress on `balance` and `sync --defrag`

This commit is contained in:
Jack Grigg 2024-09-20 23:22:34 +00:00
parent 23d1dee2da
commit 521e9bab2b
2 changed files with 19 additions and 1 deletions

View File

@ -60,6 +60,12 @@ impl Command {
(*progress.numerator() as f64) * 100f64 / (*progress.denominator() as f64)
);
}
if let Some(progress) = wallet_summary.recovery_progress() {
println!(
" Recovered: {:0.3}%",
(*progress.numerator() as f64) * 100f64 / (*progress.denominator() as f64)
);
}
println!(" Balance: {}", printer.format(balance.total()));
println!(
" Sapling Spendable: {}",

View File

@ -333,7 +333,19 @@ impl App {
/ (*progress.denominator() as f64)
))
});
[synced]
let recovered = wallet_summary.recovery_progress().map(|progress| {
Span::raw(format!(
"Recovered: {:0.3}%",
(*progress.numerator() as f64) * 100f64
/ (*progress.denominator() as f64)
))
});
let separator =
(synced.is_some() && recovered.is_some()).then(|| Span::raw(" | "));
[synced, separator, recovered]
})
.flatten(),
);