Sync before height command

This commit is contained in:
Aditya Kulkarni 2019-11-13 15:05:07 -08:00
parent 3e3f445ca3
commit 61dc063fe1

View File

@ -627,10 +627,13 @@ impl Command for HeightCommand {
}
fn exec(&self, _args: &[&str], lightclient: &LightClient) -> String {
format!("{}",
match lightclient.do_sync(true) {
Ok(_) => format!("{}",
object! {
"height" => lightclient.last_scanned_height()
}.pretty(2))
}.pretty(2)),
Err(e) => e
}
}
}