diff --git a/modules/chain/dap_chain_ch.c b/modules/chain/dap_chain_ch.c index 98eef65ffe41e75028818a9269659657618a5404..3b0bb19f15bea6d39cec53a7471a49038b7df7a9 100644 --- a/modules/chain/dap_chain_ch.c +++ b/modules/chain/dap_chain_ch.c @@ -618,11 +618,10 @@ static bool s_sync_in_chains_callback(void *a_arg) DAP_DELETE(l_args); return false; } - char *l_atom_hash_str = NULL; + dap_hash_fast_t l_atom_hash = { }; - dap_hash_fast(l_atom, l_atom_size, &l_atom_hash); - if (s_debug_more) - l_atom_hash_str = dap_hash_fast_to_str_static(&l_atom_hash); + dap_hash_fast(l_atom, l_atom_size, &l_atom_hash); + char *l_atom_hash_str = dap_hash_fast_to_str_static(&l_atom_hash); dap_chain_atom_verify_res_t l_atom_add_res = l_chain->callback_atom_add(l_chain, l_atom, l_atom_size, &l_atom_hash, false); bool l_ack_send = false; switch (l_atom_add_res) { diff --git a/modules/net/dap_chain_ledger.c b/modules/net/dap_chain_ledger.c index f20e687aafcc675b94b2f1408712c1c887d8649e..4a1ca060763335d1f787054fd9c3935dc0ed2e28 100644 --- a/modules/net/dap_chain_ledger.c +++ b/modules/net/dap_chain_ledger.c @@ -2697,7 +2697,8 @@ int s_emission_add_check(dap_ledger_t *a_ledger, byte_t *a_token_emission, size_ pthread_rwlock_unlock(&l_token_item->token_emissions_rwlock); if (l_token_emission_item) { debug_if(s_debug_more, L_WARNING, "Can't add token emission datum of %s %s ( %s ): already present in cache", - dap_uint256_to_char(l_emission->hdr.value, NULL), l_emission->hdr.ticker, dap_chain_hash_fast_to_str_static(a_emission_hash)); + dap_uint256_to_char(l_emission->hdr.value, NULL), l_emission->hdr.ticker, + dap_chain_hash_fast_to_str_static(a_emission_hash)); DAP_DELETE(l_emission); return DAP_LEDGER_CHECK_ALREADY_CACHED; } diff --git a/modules/net/dap_chain_net.c b/modules/net/dap_chain_net.c index d411a57f2a05536e9228982b9f282931849fd390..53d73e5020fdf38eae98762b65aec01b964cbc4b 100644 --- a/modules/net/dap_chain_net.c +++ b/modules/net/dap_chain_net.c @@ -2964,11 +2964,12 @@ void dap_chain_net_announce_addr(dap_chain_net_t *a_net) dap_return_if_fail(a_net); dap_chain_net_pvt_t *l_net_pvt = PVT(a_net); if ( l_net_pvt->node_info->ext_port ) { - dap_chain_net_node_list_request(a_net, l_net_pvt->node_info->ext_port, false, 'a'); log_it(L_INFO, "Announce our node address "NODE_ADDR_FP_STR" [ %s : %u ] in net %s", NODE_ADDR_FP_ARGS_S(g_node_addr), l_net_pvt->node_info->ext_host, l_net_pvt->node_info->ext_port, a_net->pub.name); + dap_chain_net_node_list_request(a_net, l_net_pvt->node_info->ext_port, true, 'a'); + } } diff --git a/modules/type/dag/dap_chain_cs_dag.c b/modules/type/dag/dap_chain_cs_dag.c index b8d6b9cddb7ded3eb9d4013a45bc17f05572fb6c..8c3e45e1195cd9a3aaa9b0aa1f7140d0314f9c53 100644 --- a/modules/type/dag/dap_chain_cs_dag.c +++ b/modules/type/dag/dap_chain_cs_dag.c @@ -458,11 +458,7 @@ static dap_chain_atom_verify_res_t s_chain_callback_atom_add(dap_chain_t * a_cha dap_chain_cs_dag_event_t * l_event = (dap_chain_cs_dag_event_t *) a_atom; dap_chain_hash_fast_t l_event_hash = *a_atom_hash; - if(s_debug_more) { - char l_event_hash_str[DAP_CHAIN_HASH_FAST_STR_SIZE] = { '\0' }; - dap_chain_hash_fast_to_str(&l_event_hash, l_event_hash_str, sizeof(l_event_hash_str)); - log_it(L_DEBUG, "Processing event: %s ... (size %zd)", l_event_hash_str,a_atom_size); - } + debug_if(s_debug_more, L_DEBUG, "Processing event: %s ... (size %zd)", dap_chain_hash_fast_to_str_static(&l_event_hash), a_atom_size); pthread_mutex_lock(&PVT(l_dag)->events_mutex); // check if we already have this event dap_chain_atom_verify_res_t ret = s_dap_chain_check_if_event_is_present(PVT(l_dag)->events, &l_event_hash) || @@ -808,12 +804,8 @@ static dap_chain_atom_verify_res_t s_chain_callback_atom_verify(dap_chain_t *a_c HASH_FIND(hh, PVT(l_dag)->events ,l_hash ,sizeof (*l_hash), l_event_search); pthread_mutex_unlock(l_events_mutex); if (l_event_search == NULL) { - if(s_debug_more) { - char l_hash_str[DAP_CHAIN_HASH_FAST_STR_SIZE]; - dap_chain_hash_fast_to_str(l_hash, l_hash_str, sizeof(l_hash_str)); - log_it(L_WARNING, "Hash %s wasn't in hashtable of previously parsed, event %s goes to threshold", - l_hash_str, dap_hash_fast_to_str_static(a_atom_hash)); - } + debug_if(s_debug_more, L_WARNING, "Hash %s wasn't in hashtable of previously parsed, event %s goes to threshold", + dap_hash_fast_to_str_static(l_hash), dap_hash_fast_to_str_static(a_atom_hash)); res = ATOM_MOVE_TO_THRESHOLD; break; }