From 0364d884e9d71ca6e44ccd7ac823fe03795499fd Mon Sep 17 00:00:00 2001 From: "roman.padenkov" <roman.padenkov@demlabs.net> Date: Tue, 10 Sep 2024 16:38:16 +0700 Subject: [PATCH] ... --- dap-sdk | 2 +- modules/net/dap_chain_node_cli_cmd.c | 7 +++---- modules/net/dap_chain_node_cli_cmd_tx.c | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/dap-sdk b/dap-sdk index 9e7565c941..28a6eeb145 160000 --- a/dap-sdk +++ b/dap-sdk @@ -1 +1 @@ -Subproject commit 9e7565c9417bad979e90b83ccd537aecfe7c07f9 +Subproject commit 28a6eeb1458c430cc164881c0e01184cbd2240d9 diff --git a/modules/net/dap_chain_node_cli_cmd.c b/modules/net/dap_chain_node_cli_cmd.c index 3ed810d552..167d74d35c 100644 --- a/modules/net/dap_chain_node_cli_cmd.c +++ b/modules/net/dap_chain_node_cli_cmd.c @@ -7408,10 +7408,9 @@ int com_tx_history(int a_argc, char ** a_argv, void **a_str_reply) json_object_array_add(*json_arr_reply, json_obj_summary); return DAP_CHAIN_NODE_CLI_COM_TX_HISTORY_OK; } else if (l_is_tx_count) { - size_t t1 = l_chain->callback_count_atom(l_chain); - size_t t2 = l_chain->callback_count_tx(l_chain); - if(t1>t2) - json_object_array_add(*json_arr_reply, json_object_new_string("empty")); + json_object * json_count_obj= json_object_new_object(); + json_object_object_add(json_count_obj, "Number of transaction", json_object_new_uint64(l_chain->callback_count_tx(l_chain))); + json_object_array_add(*json_arr_reply, json_count_obj); } 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 ccd6b5fde5..e2f6091f28 100644 --- a/modules/net/dap_chain_node_cli_cmd_tx.c +++ b/modules/net/dap_chain_node_cli_cmd_tx.c @@ -342,7 +342,7 @@ json_object* dap_db_history_addr(dap_chain_addr_t *a_addr, dap_chain_t *a_chain, bool look_for_unknown_service = (a_srv && strcmp(a_srv,"unknown") == 0); size_t l_arr_start = 0; size_t l_arr_end = 0; - s_set_offset_limit_json(json_obj_datum, &l_arr_start, &l_arr_end, a_limit, a_offset, a_chain->callback_count_atom(a_chain)); + s_set_offset_limit_json(json_obj_datum, &l_arr_start, &l_arr_end, a_limit, a_offset, a_chain->callback_count_tx(a_chain)); size_t i_tmp = 0; size_t @@ -750,7 +750,7 @@ json_object *dap_db_history_tx_all(dap_chain_t *a_chain, dap_chain_net_t *a_net, json_object * json_tx_history = NULL; size_t l_arr_start = 0; size_t l_arr_end = 0; - s_set_offset_limit_json(json_arr_out, &l_arr_start, &l_arr_end, a_limit, a_offset, a_chain->callback_count_atom(a_chain)); + s_set_offset_limit_json(json_arr_out, &l_arr_start, &l_arr_end, a_limit, a_offset, a_chain->callback_count_tx(a_chain)); bool look_for_unknown_service = (a_srv && strcmp(a_srv,"unknown") == 0); if(a_head) -- GitLab