upstream updates

This commit is contained in:
DenioD
2020-05-09 10:34:33 +02:00
parent d3a66550ed
commit 84b1b75f2c
11 changed files with 140 additions and 73 deletions

View File

@@ -11,7 +11,7 @@ use silentdragonlitelib::{commands,
#[macro_export]
macro_rules! configure_clapapp {
( $freshapp: expr ) => {
$freshapp.version("1.0.0")
$freshapp.version("1.3.2")
.arg(Arg::with_name("dangerous")
.long("dangerous")
.help("Disable server TLS certificate verification. Use this if you're running a local lightwalletd with a self-signed certificate. WARNING: This is dangerous, don't use it with a server that is not your own.")
@@ -25,6 +25,10 @@ macro_rules! configure_clapapp {
.long("recover")
.help("Attempt to recover the seed from the wallet")
.takes_value(false))
.arg(Arg::with_name("password")
.long("password")
.help("When recovering seed, specify a password for the encrypted wallet")
.takes_value(true))
.arg(Arg::with_name("seed")
.short("s")
.long("seed")
@@ -232,7 +236,7 @@ pub fn command_loop(lightclient: Arc<LightClient>) -> (Sender<(String, Vec<Strin
(command_tx, resp_rx)
}
pub fn attempt_recover_seed() {
pub fn attempt_recover_seed(password: Option<String>) {
// Create a Light Client Config in an attempt to recover the file.
let config = LightClientConfig {
server: "0.0.0.0:0".parse().unwrap(),
@@ -244,7 +248,7 @@ pub fn attempt_recover_seed() {
data_dir: None,
};
match LightClient::attempt_recover_seed(&config) {
match LightClient::attempt_recover_seed(&config, password) {
Ok(seed) => println!("Recovered seed: '{}'", seed),
Err(e) => eprintln!("Failed to recover seed. Error: {}", e)
};