diff --git a/src/wallet/monero_wallet_core.cpp b/src/wallet/monero_wallet_core.cpp index c9bdaea..94bdc27 100644 --- a/src/wallet/monero_wallet_core.cpp +++ b/src/wallet/monero_wallet_core.cpp @@ -994,7 +994,15 @@ namespace monero { return static_cast(m_w2->nettype()); } + string monero_wallet_core::get_mnemonic() const { + if (m_w2->watch_only()) throw runtime_error("The wallet is watch-only. Cannot retrieve mnemonic."); + epee::wipeable_string wipeable_mnemonic; + m_w2->get_seed(wipeable_mnemonic); + return string(wipeable_mnemonic.data(), wipeable_mnemonic.size()); + } + string monero_wallet_core::get_mnemonic_language() const { + if (m_w2->watch_only()) throw runtime_error("The wallet is watch-only. Cannot retrieve mnemonic language."); return m_w2->get_seed_language(); } @@ -1004,12 +1012,6 @@ namespace monero { return languages; } - string monero_wallet_core::get_mnemonic() const { - epee::wipeable_string wipeable_mnemonic; - m_w2->get_seed(wipeable_mnemonic); - return string(wipeable_mnemonic.data(), wipeable_mnemonic.size()); - } - string monero_wallet_core::get_public_view_key() const { MTRACE("get_private_view_key()"); return epee::string_tools::pod_to_hex(m_w2->get_account().get_keys().m_account_address.m_view_public_key);