From 824e161fbb7ef30f96e520d006361c4806e9b1fc Mon Sep 17 00:00:00 2001 From: cryptozoidberg Date: Fri, 17 Jul 2020 19:54:14 +0200 Subject: [PATCH] disabled auditable wallets in moobile version(will be added in next releases) --- src/common/error_codes.h | 1 + src/wallet/wallets_manager.cpp | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/src/common/error_codes.h b/src/common/error_codes.h index f8ad7898..2878c300 100644 --- a/src/common/error_codes.h +++ b/src/common/error_codes.h @@ -21,6 +21,7 @@ #define API_RETURN_CODE_WRONG_PASSWORD "WRONG_PASSWORD" #define API_RETURN_CODE_WALLET_WRONG_ID "WALLET_WRONG_ID" #define API_RETURN_CODE_WALLET_WATCH_ONLY_NOT_SUPPORTED "WALLET_WATCH_ONLY_NOT_SUPPORTED" +#define API_RETURN_CODE_WALLET_AUDITABLE_NOT_SUPPORTED "WALLET_AUDITABLE_NOT_SUPPORTED" #define API_RETURN_CODE_FILE_NOT_FOUND "FILE_NOT_FOUND" #define API_RETURN_CODE_ALREADY_EXISTS "ALREADY_EXISTS" #define API_RETURN_CODE_CANCELED "CANCELED" diff --git a/src/wallet/wallets_manager.cpp b/src/wallet/wallets_manager.cpp index 2fe43930..095d1ed9 100644 --- a/src/wallet/wallets_manager.cpp +++ b/src/wallet/wallets_manager.cpp @@ -853,6 +853,13 @@ std::string wallets_manager::open_wallet(const std::wstring& path, const std::st w->load(path, password); if (w->is_watch_only() && !w->is_auditable()) return API_RETURN_CODE_WALLET_WATCH_ONLY_NOT_SUPPORTED; +#ifndef MOBILE_WALLET_BUILD + //disable auditable wallets for now in mobile wallet + if (w->is_auditable()) + { + return API_RETURN_CODE_WALLET_AUDITABLE_NOT_SUPPORTED; + } +#endif w->get_recent_transfers_history(owr.recent_history.history, 0, txs_to_return, owr.recent_history.total_history_items); //w->get_unconfirmed_transfers(owr.recent_history.unconfirmed); w->get_unconfirmed_transfers(owr.recent_history.history); @@ -1056,6 +1063,13 @@ std::string wallets_manager::restore_wallet(const std::wstring& path, const std: { bool auditable_watch_only = restore_key.find(':') != std::string::npos; w->restore(path, password, restore_key, auditable_watch_only); +#ifndef MOBILE_WALLET_BUILD + //disable auditable wallets for now in mobile wallet + if (w->is_auditable()) + { + return API_RETURN_CODE_WALLET_AUDITABLE_NOT_SUPPORTED; + } +#endif owr.seed = w->get_account().get_seed_phrase(); } catch (const tools::error::file_exists&)