simplewallet: forbid seed commands for watch only wallets

They do not make sense
This commit is contained in:
moneromooo-monero 2015-06-20 12:27:23 +01:00
parent f43f0660aa
commit 4bf6f0d57a
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3

View file

@ -224,6 +224,11 @@ bool simple_wallet::seed(const std::vector<std::string> &args/* = std::vector<st
bool success = false; bool success = false;
std::string electrum_words; 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->is_deterministic())
{ {
if (m_wallet->get_seed_language().empty()) 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 simple_wallet::seed_set_language(const std::vector<std::string> &args/* = std::vector<std::string>()*/)
{ {
bool success = false; 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()) if (!m_wallet->is_deterministic())
{ {
fail_msg_writer() << "This wallet is non-deterministic and doesn't have a seed."; fail_msg_writer() << "This wallet is non-deterministic and doesn't have a seed.";