aboutsummaryrefslogtreecommitdiff
path: root/src/simplewallet
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-03-07 13:54:18 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-03-07 14:24:14 +0000
commit1979d53d78bf0f94e442191c8766fcbc79778be6 (patch)
tree336ed9670ab062dd98ee870e2767433d0080f0bc /src/simplewallet
parentMerge pull request #3253 (diff)
downloadmonero-1979d53d78bf0f94e442191c8766fcbc79778be6.tar.xz
wallet: fixes and tweaks to the save_watch_only command
- save the new keys file as FOO-watchonly.keys, not FOO.keys-watchonly - catch any exception (eg, I/O errors) and error out - print the new keys filename in simplewallet
Diffstat (limited to 'src/simplewallet')
-rw-r--r--src/simplewallet/simplewallet.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp
index c618869f2..3ac8888e5 100644
--- a/src/simplewallet/simplewallet.cpp
+++ b/src/simplewallet/simplewallet.cpp
@@ -3143,7 +3143,17 @@ bool simple_wallet::save_watch_only(const std::vector<std::string> &args/* = std
return true;
}
- m_wallet->write_watch_only_wallet(m_wallet_file, pwd_container->password());
+ try
+ {
+ std::string new_keys_filename;
+ m_wallet->write_watch_only_wallet(m_wallet_file, pwd_container->password(), new_keys_filename);
+ success_msg_writer() << tr("Watch only wallet saved as: ") << new_keys_filename;
+ }
+ catch (const std::exception &e)
+ {
+ fail_msg_writer() << tr("Failed to save watch only wallet: ") << e.what();
+ return true;
+ }
return true;
}