Skip to content
Snippets Groups Projects
Commit d67551e5 authored by oljas.jarasbaev's avatar oljas.jarasbaev
Browse files

[*]notify fix

parent 0e322982
No related branches found
No related tags found
1 merge request!1693Bugfix 11834
Pipeline #41189 passed with stage
in 13 minutes and 17 seconds
...@@ -582,13 +582,14 @@ int dap_chain_save_all(dap_chain_t *l_chain) ...@@ -582,13 +582,14 @@ int dap_chain_save_all(dap_chain_t *l_chain)
return l_ret; return l_ret;
} }
//send chain downloading data to notify socket
bool download_notify_callback(dap_chain_t* a_chain) { bool download_notify_callback(dap_chain_t* a_chain) {
json_object* l_chain_info = json_object_new_object(); json_object* l_chain_info = json_object_new_object();
json_object_object_add(l_chain_info, "net_id", json_object_new_uint64(a_chain->net_id.uint64)); json_object_object_add(l_chain_info, "net_id", json_object_new_uint64(a_chain->net_id.uint64));
json_object_object_add(l_chain_info, "chain_id", json_object_new_uint64(a_chain->id.uint64)); json_object_object_add(l_chain_info, "chain_id", json_object_new_uint64(a_chain->id.uint64));
json_object_object_add(l_chain_info, "cell_id", json_object_new_uint64(a_chain->active_cell_id.uint64)); json_object_object_add(l_chain_info, "cell_id", json_object_new_uint64(a_chain->active_cell_id.uint64));
json_object_object_add(l_chain_info, "download_percentage", json_object_new_int(a_chain->download_percentage)); json_object_object_add(l_chain_info, "download_percentage", json_object_new_int(a_chain->download_percentage));
dap_notify_server_send_mt(l_chain_info); dap_notify_server_send_mt(json_object_get_string(l_chain_info));
log_it(L_DEBUG, "Download notify: net_name: %s; chain_id: %d; download:%d%c", a_chain->net_name, a_chain->id.uint64, a_chain->download_percentage, '%'); log_it(L_DEBUG, "Download notify: net_name: %s; chain_id: %d; download:%d%c", a_chain->net_name, a_chain->id.uint64, a_chain->download_percentage, '%');
json_object_put(l_chain_info); json_object_put(l_chain_info);
return true; return true;
......
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