diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2015-06-20 12:27:23 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2015-06-20 12:27:23 +0100 |
commit | 4bf6f0d57a30d78fc191a375077eb9c04448a35f (patch) | |
tree | f0a77e1c2d752d6324b55e49555a189daa3682cc | |
parent | Merge pull request #322 (diff) | |
download | monero-4bf6f0d57a30d78fc191a375077eb9c04448a35f.tar.xz |
simplewallet: forbid seed commands for watch only wallets
They do not make sense
Diffstat (limited to '')
-rw-r--r-- | src/simplewallet/simplewallet.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index c4d0acb7a..eb0bce7ae 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -224,6 +224,11 @@ bool simple_wallet::seed(const std::vector<std::string> &args/* = std::vector<st bool success = false; std::string electrum_words; + if (m_wallet->watch_only()) + { + fail_msg_writer() << "This wallet is watch-only and cannot have a seed."; + return true; + } if (m_wallet->is_deterministic()) { if (m_wallet->get_seed_language().empty()) @@ -249,6 +254,11 @@ bool simple_wallet::seed(const std::vector<std::string> &args/* = std::vector<st bool simple_wallet::seed_set_language(const std::vector<std::string> &args/* = std::vector<std::string>()*/) { bool success = false; + if (m_wallet->watch_only()) + { + fail_msg_writer() << "This wallet is watch-only and doesn't have a seed."; + return true; + } if (!m_wallet->is_deterministic()) { fail_msg_writer() << "This wallet is non-deterministic and doesn't have a seed."; |