mirror of
https://github.com/Qortal/piratewallet-light-cli.git
synced 2025-02-01 03:12:15 +00:00
Prevent unnecessary syncs
This commit is contained in:
parent
6fa8d1f365
commit
6150fe0ac6
@ -220,10 +220,7 @@ impl Command for BalanceCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn exec(&self, _args: &[&str], lightclient: &LightClient) -> String {
|
fn exec(&self, _args: &[&str], lightclient: &LightClient) -> String {
|
||||||
match lightclient.do_sync(true) {
|
format!("{}", lightclient.do_balance().pretty(2))
|
||||||
Ok(_) => format!("{}", lightclient.do_balance().pretty(2)),
|
|
||||||
Err(e) => e
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -628,12 +625,7 @@ impl Command for TransactionsCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn exec(&self, _args: &[&str], lightclient: &LightClient) -> String {
|
fn exec(&self, _args: &[&str], lightclient: &LightClient) -> String {
|
||||||
match lightclient.do_sync(true) {
|
|
||||||
Ok(_) => {
|
|
||||||
format!("{}", lightclient.do_list_transactions().pretty(2))
|
format!("{}", lightclient.do_list_transactions().pretty(2))
|
||||||
},
|
|
||||||
Err(e) => e
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -659,15 +651,8 @@ impl Command for HeightCommand {
|
|||||||
return format!("Didn't understand arguments\n{}", self.help());
|
return format!("Didn't understand arguments\n{}", self.help());
|
||||||
}
|
}
|
||||||
|
|
||||||
if args.len() == 0 || (args.len() == 1 && args[0].trim() == "true") {
|
|
||||||
match lightclient.do_sync(true) {
|
|
||||||
Ok(_) => format!("{}", object! { "height" => lightclient.last_scanned_height()}.pretty(2)),
|
|
||||||
Err(e) => e
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
format!("{}", object! { "height" => lightclient.last_scanned_height()}.pretty(2))
|
format!("{}", object! { "height" => lightclient.last_scanned_height()}.pretty(2))
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -734,12 +719,7 @@ impl Command for NotesCommand {
|
|||||||
false
|
false
|
||||||
};
|
};
|
||||||
|
|
||||||
match lightclient.do_sync(true) {
|
|
||||||
Ok(_) => {
|
|
||||||
format!("{}", lightclient.do_list_notes(all_notes).pretty(2))
|
format!("{}", lightclient.do_list_notes(all_notes).pretty(2))
|
||||||
},
|
|
||||||
Err(e) => e
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user