From 03571f5919c44de8c531b1ec9b89d07edf84fdd9 Mon Sep 17 00:00:00 2001 From: "roman.padenkov" <roman.padenkov@demlabs.net> Date: Fri, 13 Sep 2024 16:39:20 +0700 Subject: [PATCH] ... --- modules/net/dap_chain_node_cli_cmd.c | 8 +------ modules/net/dap_chain_node_cli_cmd_tx.c | 21 ------------------- .../net/include/dap_chain_node_cli_cmd_tx.h | 1 - 3 files changed, 1 insertion(+), 29 deletions(-) diff --git a/modules/net/dap_chain_node_cli_cmd.c b/modules/net/dap_chain_node_cli_cmd.c index fb6a954d48..e8b1aa3c31 100644 --- a/modules/net/dap_chain_node_cli_cmd.c +++ b/modules/net/dap_chain_node_cli_cmd.c @@ -7266,10 +7266,8 @@ int com_tx_history(int a_argc, char ** a_argv, void **a_str_reply) bool l_brief = (dap_cli_server_cmd_check_option(a_argv, arg_index, a_argc, "-brief") != -1) ? true : false; bool l_is_tx_all = dap_cli_server_cmd_find_option_val(a_argv, arg_index, a_argc, "-all", NULL); - bool l_map1 = dap_cli_server_cmd_find_option_val(a_argv, arg_index, a_argc, "-map1", NULL); - bool l_map2 = dap_cli_server_cmd_find_option_val(a_argv, arg_index, a_argc, "-map2", NULL); - if (!l_addr_base58 && !l_wallet_name && !l_tx_hash_str && !l_is_tx_all && !l_map1 && !l_map2) { + if (!l_addr_base58 && !l_wallet_name && !l_tx_hash_str && !l_is_tx_all) { dap_json_rpc_error_add(DAP_CHAIN_NODE_CLI_COM_TX_HISTORY_PARAM_ERR, "tx_history requires parameter '-addr' or '-w' or '-tx'"); return DAP_CHAIN_NODE_CLI_COM_TX_HISTORY_PARAM_ERR; @@ -7408,10 +7406,6 @@ int com_tx_history(int a_argc, char ** a_argv, void **a_str_reply) json_object_array_add(*json_arr_reply, json_arr_history_all); json_object_array_add(*json_arr_reply, json_obj_summary); return DAP_CHAIN_NODE_CLI_COM_TX_HISTORY_OK; - } else if (l_map1){ - to_map_1(true, l_chain); - } else if (l_map2){ - to_map_1(false, l_chain); } if (json_obj_out) { diff --git a/modules/net/dap_chain_node_cli_cmd_tx.c b/modules/net/dap_chain_node_cli_cmd_tx.c index 491d9caf4f..ea51f3caf9 100644 --- a/modules/net/dap_chain_node_cli_cmd_tx.c +++ b/modules/net/dap_chain_node_cli_cmd_tx.c @@ -46,7 +46,6 @@ #include "dap_chain_mempool.h" #include "dap_math_convert.h" #include "dap_json_rpc_errors.h" -#include <sys/mman.h> #define LOG_TAG "chain_node_cli_cmd_tx" @@ -738,26 +737,6 @@ static int s_json_tx_history_pack(json_object** a_json_obj_datum, dap_chain_datu } return 0; -} -void to_map_1(bool a_t, dap_chain_t *a_chain){ - dap_chain_cell_t *l_cell, *l_iter_tmp; - HASH_ITER(hh, a_chain->cells, l_cell, l_iter_tmp) { - for (dap_list_t *it = l_cell->map_range_bounds; it; it = it->next) { - if (a_t){ - int error = madvise(it->data, it->next->data - it->data, MADV_SEQUENTIAL); - log_it(L_MSG, "MADV_SEQ %d", error); - //int error2 = madvise(it->data, it->next->data - it->data, MADV_POPULATE_READ); - //log_it(L_MSG, "MADV_POPL_READ %d", error2); - - } else { - int error3 = madvise(it->data, it->next->data - it->data, MADV_WILLNEED); - log_it(L_MSG, "MADV_WILLNEED %d", error3); - } - - it = it->next; - } - } - } json_object *dap_db_history_tx_all(dap_chain_t *a_chain, dap_chain_net_t *a_net, diff --git a/modules/net/include/dap_chain_node_cli_cmd_tx.h b/modules/net/include/dap_chain_node_cli_cmd_tx.h index 00f059a61b..375f1f34f2 100644 --- a/modules/net/include/dap_chain_node_cli_cmd_tx.h +++ b/modules/net/include/dap_chain_node_cli_cmd_tx.h @@ -112,5 +112,4 @@ typedef enum s_com_token_err{ * */ int cmd_decree(int a_argc, char **a_argv, void **a_str_reply); -void to_map_1(bool a_t, dap_chain_t *a_chain); -- GitLab