diff --git a/src/currency_core/account.h b/src/currency_core/account.h index 606ea74d..0d9abbdd 100644 --- a/src/currency_core/account.h +++ b/src/currency_core/account.h @@ -65,6 +65,8 @@ namespace currency bool store(const std::string& file_path); void make_account_watch_only(); + bool is_watch_only() const { return m_keys.spend_secret_key == currency::null_skey; } + bool is_auditable() const { return m_keys.account_address.is_auditable(); } template inline void serialize(t_archive &a, const unsigned int /*ver*/) diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index ebbd5969..cfdf5269 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -2324,6 +2324,8 @@ void wallet2::assign_account(const currency::account_base& acc) clear(); m_account = acc; init_log_prefix(); + if (m_account.is_watch_only()) + m_watch_only = true; } //---------------------------------------------------------------------------------------------------- void wallet2::generate(const std::wstring& path, const std::string& pass, bool auditable_wallet)