Fix #3297 use the password_prompter helper

This commit is contained in:
Howard Chu 2018-02-20 02:25:20 +00:00
parent 4f80c50730
commit f2bb8085ec
No known key found for this signature in database
GPG key ID: FD2A70B44AB11BA7

View file

@ -561,10 +561,7 @@ bool simple_wallet::print_seed(bool encrypted)
epee::wipeable_string seed_pass; epee::wipeable_string seed_pass;
if (encrypted) if (encrypted)
{ {
#ifdef HAVE_READLINE auto pwd_container = password_prompter(tr("Enter optional seed encryption passphrase, empty to see raw seed"), true);
rdln::suspend_readline pause_readline;
#endif
auto pwd_container = tools::password_container::prompt(true, tr("Enter optional seed encryption passphrase, empty to see raw seed"));
if (std::cin.eof() || !pwd_container) if (std::cin.eof() || !pwd_container)
return true; return true;
seed_pass = pwd_container->password(); seed_pass = pwd_container->password();
@ -2145,10 +2142,7 @@ bool simple_wallet::init(const boost::program_options::variables_map& vm)
} }
} }
#ifdef HAVE_READLINE auto pwd_container = password_prompter(tr("Enter seed encryption passphrase, empty if none"), false);
rdln::suspend_readline pause_readline;
#endif
auto pwd_container = tools::password_container::prompt(false, tr("Enter seed encryption passphrase, empty if none"));
if (std::cin.eof() || !pwd_container) if (std::cin.eof() || !pwd_container)
return false; return false;
epee::wipeable_string seed_pass = pwd_container->password(); epee::wipeable_string seed_pass = pwd_container->password();
@ -3003,7 +2997,7 @@ bool simple_wallet::save_watch_only(const std::vector<std::string> &args/* = std
return true; return true;
} }
const auto pwd_container = tools::password_container::prompt(true, tr("Password for new watch-only wallet")); const auto pwd_container = password_prompter(tr("Password for new watch-only wallet"), true);
if (!pwd_container) if (!pwd_container)
{ {