From 0b636ed0702f23e16943527137239a0cd746ce45 Mon Sep 17 00:00:00 2001 From: cryptozoidberg Date: Tue, 2 Jun 2020 00:19:54 +0200 Subject: [PATCH] added reset method for quick releasing opened wallets under android --- src/wallet/plain_wallet_api.cpp | 9 +++++++++ src/wallet/plain_wallet_api.h | 1 + 2 files changed, 10 insertions(+) diff --git a/src/wallet/plain_wallet_api.cpp b/src/wallet/plain_wallet_api.cpp index fbb1c477..1f1b2b6d 100644 --- a/src/wallet/plain_wallet_api.cpp +++ b/src/wallet/plain_wallet_api.cpp @@ -168,6 +168,15 @@ namespace plain_wallet } } + + std::string reset() + { + GET_INSTANCE_PTR(inst_ptr); + inst_ptr->gwm.quick_stop_no_save(); + epee::json_rpc::response ok_response = AUTO_VAL_INIT(ok_response); + ok_response.result.return_code = API_RETURN_CODE_OK; + return epee::serialization::store_t_to_json(ok_response); + } std::string init(const std::string& ip, const std::string& port, const std::string& working_dir, int log_level) { diff --git a/src/wallet/plain_wallet_api.h b/src/wallet/plain_wallet_api.h index a6ef8243..3a18804d 100644 --- a/src/wallet/plain_wallet_api.h +++ b/src/wallet/plain_wallet_api.h @@ -11,6 +11,7 @@ namespace plain_wallet { typedef int64_t hwallet; std::string init(const std::string& ip, const std::string& port, const std::string& working_dir, int log_level); + std::string reset(); std::string set_log_level(int log_level); std::string get_version(); std::string get_wallet_files();