Add syncstatus command

This commit is contained in:
Aditya Kulkarni
2019-10-24 18:26:25 -07:00
parent 17bbb71a69
commit 865a72442d
3 changed files with 66 additions and 43 deletions

View File

@@ -221,7 +221,12 @@ fn startup(server: http::Uri, dangerous: bool, seed: Option<String>, birthday: u
if first_sync {
let update = lightclient.do_sync(true);
if print_updates {
println!("{}", update);
match update {
Ok(j) => {
println!("{}", j.pretty(2));
},
Err(e) => println!("{}", e)
}
}
}
@@ -329,7 +334,11 @@ fn command_loop(lightclient: Arc<LightClient>) -> (Sender<(String, Vec<String>)>
Err(_) => {
// Timeout. Do a sync to keep the wallet up-to-date. False to whether to print updates on the console
info!("Timeout, doing a sync");
lc.do_sync(false);
match lc.do_sync(false) {
Ok(_) => {},
Err(e) => {error!("{}", e)}
}
}
}
}