Wallet listener and server startup ambiguity fix (#774)

* unify code path for server run and create wallet seed if it doesn't exist

* rustfmt
This commit is contained in:
Yeastplume
2018-03-14 18:21:48 +00:00
committed by GitHub
parent 6a1a45e21f
commit c02309ce87
3 changed files with 90 additions and 91 deletions
+8 -5
View File
@@ -125,6 +125,10 @@ pub enum ErrorKind {
#[fail(display = "Wallet seed exists error")]
WalletSeedExists,
/// Wallet seed doesn't exist
#[fail(display = "Wallet seed doesn't exist error")]
WalletSeedDoesntExist,
#[fail(display = "Generic error: {}", _0)] GenericError(&'static str),
}
@@ -471,12 +475,11 @@ impl WalletSeed {
} else {
error!(
LOGGER,
"Run: \"grin wallet init\" to initialize a new wallet.",
);
panic!(format!(
"wallet seed file {} could not be opened (grin wallet init)",
"wallet seed file {} could not be opened (grin wallet init). \
Run \"grin wallet init\" to initialize a new wallet.",
seed_file_path
));
);
Err(ErrorKind::WalletSeedDoesntExist)?
}
}
}