diff options
author | Riccardo Spagni <ric@spagni.net> | 2015-06-14 13:09:14 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2015-06-14 13:09:16 +0200 |
commit | 66a5c9e50fee08096117266e94ba02d39a7570ea (patch) | |
tree | deb3552b3a30aef447c053cba08338e8005193d5 /src/simplewallet/simplewallet.cpp | |
parent | Merge pull request #317 (diff) | |
parent | simplewallet: allow a different password for the watch-only wallet (diff) | |
download | monero-66a5c9e50fee08096117266e94ba02d39a7570ea.tar.xz |
Merge pull request #318
fb20071 simplewallet: allow a different password for the watch-only wallet (moneromooo-monero)
Diffstat (limited to 'src/simplewallet/simplewallet.cpp')
-rw-r--r-- | src/simplewallet/simplewallet.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index 6ed7bdcda..c4d0acb7a 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -768,18 +768,23 @@ bool simple_wallet::save_watch_only(const std::vector<std::string> &args/* = std { bool success = false; tools::password_container pwd_container; - success = pwd_container.read_password(); + + success = pwd_container.read_password("Password for the new watch-only wallet"); if (!success) { fail_msg_writer() << "failed to read wallet password"; return true; } - - /* verify password before using so user doesn't accidentally set a new password for rewritten wallet */ - success = m_wallet->verify_password(pwd_container.password()); + std::string password = pwd_container.password(); + success = pwd_container.read_password("Enter new password again"); if (!success) { - fail_msg_writer() << "invalid password"; + fail_msg_writer() << "failed to read wallet password"; + return true; + } + if (password != pwd_container.password()) + { + fail_msg_writer() << "passwords do not match"; return true; } |