summaryrefslogtreecommitdiff
path: root/patches/zano/0010-relax-mutex-in-invoke-call.patch
diff options
context:
space:
mode:
authorrenovate[bot] <29139614+renovate[bot]@users.noreply.github.com>2025-03-04 12:27:45 +0100
committerGitHub <noreply@github.com>2025-03-04 12:27:45 +0100
commitfdb16635cbfe1d45a3d5869c0a55ec871d912ea0 (patch)
treeec6703c28b4f09c6d10f56339db78a3cdb2c8b82 /patches/zano/0010-relax-mutex-in-invoke-call.patch
parent991a0d0c97bce6ae8671dc763dd03876dfa9ea8a (diff)
chore(deps): update zano digest to fe85ce2 (#116)
* chore(deps): update zano digest to fe85ce2 * rebase needed patches * fix integration tests, generate checksum --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Czarek Nakamoto <cyjan@mrcyjanek.net>
Diffstat (limited to 'patches/zano/0010-relax-mutex-in-invoke-call.patch')
-rw-r--r--patches/zano/0010-relax-mutex-in-invoke-call.patch88
1 files changed, 0 insertions, 88 deletions
diff --git a/patches/zano/0010-relax-mutex-in-invoke-call.patch b/patches/zano/0010-relax-mutex-in-invoke-call.patch
deleted file mode 100644
index e3e29a7..0000000
--- a/patches/zano/0010-relax-mutex-in-invoke-call.patch
+++ /dev/null
@@ -1,88 +0,0 @@
-From 2421d1fb4b4c50c1372361b1688f7d9fff9ef716 Mon Sep 17 00:00:00 2001
-From: Czarek Nakamoto <cyjan@mrcyjanek.net>
-Date: Tue, 18 Feb 2025 14:27:36 +0100
-Subject: [PATCH] relax mutex in invoke call
-
----
- src/common/error_codes.h | 1 +
- src/wallet/wallets_manager.cpp | 37 ++++++++++++++++++++++++++++++----
- 2 files changed, 34 insertions(+), 4 deletions(-)
-
-diff --git a/src/common/error_codes.h b/src/common/error_codes.h
-index 1e3dc2efc..4723afe40 100644
---- a/src/common/error_codes.h
-+++ b/src/common/error_codes.h
-@@ -45,3 +45,4 @@
- #define API_RETURN_CODE_HTLC_ORIGIN_HASH_MISSMATCHED "HTLC_ORIGIN_HASH_MISSMATCHED"
- #define API_RETURN_CODE_WRAP "WRAP"
- #define API_RETURN_CODE_MISSING_ZC_INPUTS "MISSING_ZC_INPUTS"
-+#define API_RETURN_CODE_BAD_JSON "BAD_JSON"
-\ No newline at end of file
-diff --git a/src/wallet/wallets_manager.cpp b/src/wallet/wallets_manager.cpp
-index 7155771d2..3da57dc7a 100644
---- a/src/wallet/wallets_manager.cpp
-+++ b/src/wallet/wallets_manager.cpp
-@@ -1675,10 +1675,27 @@ std::string wallets_manager::get_wallet_status(uint64_t wallet_id)
- return epee::serialization::store_t_to_json(wsi);
- }
-
-+struct json_just_method
-+{
-+ std::string method;
-+ BEGIN_KV_SERIALIZE_MAP()
-+ KV_SERIALIZE(method)
-+ END_KV_SERIALIZE_MAP()
-+};
-+
- std::string wallets_manager::invoke(uint64_t wallet_id, std::string params)
- {
- GET_WALLET_OPT_BY_ID(wallet_id, wo);
-
-+ json_just_method req = {};
-+ if (!epee::serialization::load_t_from_json(req, params))
-+ {
-+ epee::json_rpc::response<epee::json_rpc::dummy_result, epee::json_rpc::error> error_response = AUTO_VAL_INIT(error_response);
-+ error_response.error.code = -1;
-+ error_response.error.message = API_RETURN_CODE_BAD_JSON;
-+ return epee::serialization::store_t_to_json(error_response);
-+ }
-+
- CRITICAL_REGION_LOCAL1(wo.long_refresh_in_progress_lock);
- if (wo.long_refresh_in_progress)
- {
-@@ -1688,16 +1705,28 @@ std::string wallets_manager::invoke(uint64_t wallet_id, std::string params)
- return epee::serialization::store_t_to_json(error_response);
- }
-
--
-- auto locker_object = wo.w.lock();
--
- epee::net_utils::http::http_request_info query_info = AUTO_VAL_INIT(query_info);
- epee::net_utils::http::http_response_info response_info = AUTO_VAL_INIT(response_info);
- epee::net_utils::connection_context_base stub_conn_context = AUTO_VAL_INIT(stub_conn_context);
- bool call_found = false;
- query_info.m_URI = "/json_rpc";
- query_info.m_body = params;
-- wo.rpc_wrapper->handle_http_request_map(query_info, response_info, stub_conn_context, call_found);
-+
-+ if (req.method != "assets_whitelist_get" &&
-+ req.method != "decrypt_data" &&
-+ req.method != "encrypt_data" &&
-+ req.method != "get_restore_info" &&
-+ req.method != "get_seed_phrase_info" &&
-+ req.method != "get_wallet_info" &&
-+ req.method != "getaddress" &&
-+ req.method != "getbalance" &&
-+ req.method != "sign_message") {
-+ auto locker_object = wo.w.lock();
-+ wo.rpc_wrapper->handle_http_request_map(query_info, response_info, stub_conn_context, call_found);
-+ } else {
-+ wo.rpc_wrapper->handle_http_request_map(query_info, response_info, stub_conn_context, call_found);
-+ }
-+
- return response_info.m_body;
- }
-
---
-2.48.1
-