diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-03-05 14:52:38 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-03-05 14:53:46 +0000 |
commit | 4b48565c9e8615028cae2c5c1cd4bddac03d5ffb (patch) | |
tree | d5850d104bb03a1861ff79b5aa1c5a9fe8f0b80b /src/simplewallet | |
parent | Merge pull request #1837 (diff) | |
download | monero-4b48565c9e8615028cae2c5c1cd4bddac03d5ffb.tar.xz |
wallet: add password command
Also tweak wallet2 password code to verify password without
saying it's a new wallet, because it's assuming things.
Diffstat (limited to 'src/simplewallet')
-rw-r--r-- | src/simplewallet/simplewallet.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index 4b5a36c83..727103fa8 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -380,9 +380,9 @@ bool simple_wallet::change_password(const std::vector<std::string> &args) return false; } - // prompts for a new password, this is not a new wallet so pass in false. - const auto pwd_container = tools::wallet2::password_prompt(false); - + // prompts for a new password, pass true to verify the password + const auto pwd_container = tools::wallet2::password_prompt(true); + try { m_wallet->rewrite(m_wallet_file, pwd_container->password()); @@ -676,6 +676,7 @@ simple_wallet::simple_wallet() m_cmd_binder.set_handler("export_outputs", boost::bind(&simple_wallet::export_outputs, this, _1), tr("Export a set of outputs owned by this wallet")); m_cmd_binder.set_handler("import_outputs", boost::bind(&simple_wallet::import_outputs, this, _1), tr("Import set of outputs owned by this wallet")); m_cmd_binder.set_handler("show_transfer", boost::bind(&simple_wallet::show_transfer, this, _1), tr("Show information about a transfer to/from this address")); + m_cmd_binder.set_handler("password", boost::bind(&simple_wallet::change_password, this, _1), tr("Change wallet password")); m_cmd_binder.set_handler("help", boost::bind(&simple_wallet::help, this, _1), tr("Show this help")); } //---------------------------------------------------------------------------------------------------- |