Skip to content
Snippets Groups Projects
Commit e80cace3 authored by alexander.lysikov's avatar alexander.lysikov
Browse files

fixed command tx_history

parent e85f8701
No related branches found
No related tags found
2 merge requests!148Master,!140fixed command tx_history
Pipeline #4127 passed with stage
in 22 seconds
...@@ -518,46 +518,47 @@ char* dap_db_history_addr(dap_chain_addr_t * a_addr, dap_chain_t * a_chain) ...@@ -518,46 +518,47 @@ char* dap_db_history_addr(dap_chain_addr_t * a_addr, dap_chain_t * a_chain)
} }
} }
char *l_dst_to_str =
(l_tx_prev_out) ? dap_chain_addr_to_str(&l_tx_prev_out->addr) :
NULL;
// if use dst addr
bool l_is_use_dst_addr = false;
if(!memcmp(&l_tx_prev_out->addr, a_addr, sizeof(dap_chain_addr_t)))
l_is_use_dst_addr = true;
l_src_str_is_cur = l_is_use_src_addr; l_src_str_is_cur = l_is_use_src_addr;
if(l_src_addr->len <= 1) { if(l_src_addr->len <= 1) {
l_src_str = l_src_str =
(l_tx_data) ? dap_chain_addr_to_str(&l_tx_data->addr) : (l_tx_data) ? dap_chain_addr_to_str(&l_tx_data->addr) :
NULL; NULL;
if(!memcmp(&l_tx_prev_out->addr, a_addr, sizeof(dap_chain_addr_t))) if(l_tx_prev_out && !memcmp(&l_tx_prev_out->addr, a_addr, sizeof(dap_chain_addr_t)))
l_src_str_is_cur = true; l_src_str_is_cur = true;
dap_string_free(l_src_addr, true); dap_string_free(l_src_addr, true);
} }
else else
l_src_str = dap_string_free(l_src_addr, false); l_src_str = dap_string_free(l_src_addr, false);
if(l_is_use_src_addr && !l_is_use_dst_addr) {
dap_string_append_printf(l_str_out, if(l_tx_prev_out) {
"tx hash %s \n %s in send %lu %s from %s\n to %s\n", char *l_dst_to_str = dap_chain_addr_to_str(&l_tx_prev_out->addr);
l_tx_data->tx_hash_str, // if use dst addr
l_time_str ? l_time_str : "", bool l_is_use_dst_addr = false;
l_tx_prev_out->header.value, if(!memcmp(&l_tx_prev_out->addr, a_addr, sizeof(dap_chain_addr_t)))
l_tx_data->token_ticker, l_is_use_dst_addr = true;
l_src_str ? l_src_str : "",
l_dst_to_str); if(l_is_use_src_addr && !l_is_use_dst_addr) {
} else if(l_is_use_dst_addr && !l_is_use_src_addr) {
if(!l_src_str_is_cur)
dap_string_append_printf(l_str_out, dap_string_append_printf(l_str_out,
"tx hash %s \n %s in recv %lu %s from %s\n", "tx hash %s \n %s in send %lu %s from %s\n to %s\n",
l_tx_data->tx_hash_str, l_tx_data->tx_hash_str,
l_time_str ? l_time_str : "", l_time_str ? l_time_str : "",
l_tx_prev_out->header.value, l_tx_prev_out->header.value,
l_tx_data->token_ticker, l_tx_data->token_ticker,
l_src_str ? l_src_str : ""); l_src_str ? l_src_str : "",
} l_dst_to_str);
} else if(l_is_use_dst_addr && !l_is_use_src_addr) {
if(!l_src_str_is_cur)
dap_string_append_printf(l_str_out,
"tx hash %s \n %s in recv %lu %s from %s\n",
l_tx_data->tx_hash_str,
l_time_str ? l_time_str : "",
l_tx_prev_out->header.value,
l_tx_data->token_ticker,
l_src_str ? l_src_str : "");
}
DAP_DELETE(l_dst_to_str); DAP_DELETE(l_dst_to_str);
}
dap_list_free(l_list_out_prev_items); dap_list_free(l_list_out_prev_items);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment