Browse Source

Sync before height command

checkpoints
Aditya Kulkarni 5 years ago
parent
commit
61dc063fe1
  1. 11
      lib/src/commands.rs

11
lib/src/commands.rs

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

Loading…
Cancel
Save