mirror of
https://github.com/Qortal/piratewallet-light-cli.git
synced 2025-01-30 18:42:15 +00:00
Save in non-interactive mode
This commit is contained in:
parent
4518965a41
commit
5905ef728b
@ -333,10 +333,20 @@ impl LightClient {
|
||||
1_000_000, // 1 MB write buffer
|
||||
File::create(self.config.get_wallet_path()).unwrap());
|
||||
|
||||
self.wallet.write(&mut file_buffer).unwrap();
|
||||
info!("Saved wallet");
|
||||
|
||||
format!("Saved Wallet")
|
||||
match self.wallet.write(&mut file_buffer) {
|
||||
Ok(_) => {
|
||||
info!("Saved wallet");
|
||||
let response = object!{
|
||||
"result" => "success"
|
||||
};
|
||||
response.pretty(2)
|
||||
},
|
||||
Err(e) => {
|
||||
let err = format!("ERR: {}", e);
|
||||
error!("{}", err);
|
||||
err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_server_uri(&self) -> http::Uri {
|
||||
|
@ -137,6 +137,10 @@ pub fn main() {
|
||||
error!("{}", e);
|
||||
}
|
||||
}
|
||||
|
||||
// Save before exit
|
||||
command_tx.send(("save".to_string(), vec![])).unwrap();
|
||||
resp_rx.recv().unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user