Skip to content
Snippets Groups Projects
Commit 7c795146 authored by Dmitriy A. Gerasimov's avatar Dmitriy A. Gerasimov
Browse files

[*] Init chain file if not present

parent d89499bd
No related branches found
No related tags found
No related merge requests found
......@@ -218,7 +218,10 @@ dap_chain_t * dap_chain_load_from_cfg(const char * a_chain_net_name, const char
l_chain_id.uint64 ,
l_chain_shard_id.uint64);
DAP_CHAIN_PVT ( l_chain)->file_storage_path = strdup ( dap_config_get_item_str (l_cfg , "files","storage") );
dap_chain_pvt_file_load (l_chain);
if ( dap_chain_pvt_file_load ( l_chain ) != 0 ){
log_it (L_NOTICE, "Init chain file");
dap_chain_pvt_file_save( l_chain );
}
}else{
dap_chain_delete(l_chain);
l_chain = NULL;
......
......@@ -67,7 +67,7 @@ int dap_chain_pvt_file_load( dap_chain_t * a_chain)
return -2;
}
}else {
log_it (L_ERROR,"Can't read dap_chain file \"%s\"",l_chain_pvt->file_storage_path);
log_it (L_WARNING,"Can't read dap_chain file \"%s\"",l_chain_pvt->file_storage_path);
return -1;
}
}
......
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