From 7a0ec043a1fafcec35d166551a0ed545094a4f7a Mon Sep 17 00:00:00 2001 From: cryptozoidberg Date: Fri, 3 May 2024 20:08:22 +0400 Subject: [PATCH] fixed issue with multithreadin and jwt rpc --- src/wallet/wallets_manager.cpp | 2 ++ src/wallet/wallets_manager.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/wallet/wallets_manager.cpp b/src/wallet/wallets_manager.cpp index 2bcdb3dd..02287be5 100644 --- a/src/wallet/wallets_manager.cpp +++ b/src/wallet/wallets_manager.cpp @@ -2124,6 +2124,7 @@ bool wallets_manager::on_mw_select_wallet(const tools::wallet_public::COMMAND_MW void wallets_manager::lock() { #ifndef MOBILE_WALLET_BUILD + m_select_wallet_rpc_lock.lock(); { SHARED_CRITICAL_REGION_LOCAL(m_wallets_lock); auto it = m_wallets.find(m_rpc_selected_wallet_id); @@ -2140,6 +2141,7 @@ void wallets_manager::unlock() { #ifndef MOBILE_WALLET_BUILD m_current_wallet_locked_object.reset(); + m_select_wallet_rpc_lock.unlock(); #endif } std::shared_ptr wallets_manager::get_wallet() diff --git a/src/wallet/wallets_manager.h b/src/wallet/wallets_manager.h index 60ea6fee..014ea3ef 100644 --- a/src/wallet/wallets_manager.h +++ b/src/wallet/wallets_manager.h @@ -234,6 +234,8 @@ private: std::mutex m_stop_singal_sent_mutex; std::condition_variable m_stop_singal_sent_mutex_cv; + std::mutex m_select_wallet_rpc_lock; + view::i_view m_view_stub; view::i_view* m_pview; std::shared_ptr m_rpc_proxy;