From 4b48565c9e8615028cae2c5c1cd4bddac03d5ffb Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Sun, 5 Mar 2017 14:52:38 +0000 Subject: wallet: add password command Also tweak wallet2 password code to verify password without saying it's a new wallet, because it's assuming things. --- src/wallet/wallet2.cpp | 4 ++-- src/wallet/wallet2.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/wallet') diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 888c158c5..523c07696 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -452,10 +452,10 @@ void wallet2::init_options(boost::program_options::options_description& desc_par command_line::add_arg(desc_params, opts.restricted); } -boost::optional wallet2::password_prompt(const bool is_new_wallet) +boost::optional wallet2::password_prompt(const bool new_password) { auto pwd_container = tools::password_container::prompt( - is_new_wallet, (is_new_wallet ? tr("Enter a password for your new wallet") : tr("Wallet password")) + new_password, (new_password ? tr("Enter new wallet password") : tr("Wallet password")) ); if (!pwd_container) { diff --git a/src/wallet/wallet2.h b/src/wallet/wallet2.h index 416b7ea69..982c19fe7 100644 --- a/src/wallet/wallet2.h +++ b/src/wallet/wallet2.h @@ -114,7 +114,7 @@ namespace tools static void init_options(boost::program_options::options_description& desc_params); //! \return Password retrieved from prompt. Logs error on failure. - static boost::optional password_prompt(const bool is_new_wallet); + static boost::optional password_prompt(const bool new_password); //! Uses stdin and stdout. Returns a wallet2 if no errors. static std::unique_ptr make_from_json(const boost::program_options::variables_map& vm, const std::string& json_file); -- cgit v1.2.3