Saner error output on multiple attempts to init wallet (#2021)

* less scary error message on duplicate wallet commit

* rustfmt
This commit is contained in:
Yeastplume
2018-11-26 12:02:18 +00:00
committed by GitHub
parent 9db36f7ba3
commit b2c177d16a
3 changed files with 31 additions and 24 deletions
+7
View File
@@ -106,6 +106,13 @@ pub fn wallet_command(wallet_args: &ArgMatches, config: GlobalWalletConfig) -> i
// Decrypt the seed from the seed file and derive the keychain.
// Generate the initial wallet seed if we are running "wallet init".
if let ("init", Some(r)) = wallet_args.subcommand() {
if let Err(e) = WalletSeed::seed_file_exists(&wallet_config) {
println!(
"Not creating wallet - Wallet seed file already exists at {}",
e.inner
);
return 0;
}
let list_length = match r.is_present("short_wordlist") {
false => 32,
true => 16,