From d9a2d43fd323ca1c0dcd4a1080c90132b62a25c8 Mon Sep 17 00:00:00 2001
From: Dmitry Gerasimov <dmitriy.gerasimov@demlabs.net>
Date: Fri, 22 Jul 2022 21:18:29 +0700
Subject: [PATCH] [*] Fixed dag rounds load

---
 modules/type/dag/dap_chain_cs_dag.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/type/dag/dap_chain_cs_dag.c b/modules/type/dag/dap_chain_cs_dag.c
index f733455e0a..1d591700c7 100644
--- a/modules/type/dag/dap_chain_cs_dag.c
+++ b/modules/type/dag/dap_chain_cs_dag.c
@@ -279,7 +279,7 @@ int dap_chain_cs_dag_new(dap_chain_t * a_chain, dap_config_t * a_chain_cfg)
     dap_chain_global_db_add_sync_extra_group(l_net->pub.name, l_dag->gdb_group_events_round_new, s_history_callback_round_notify, l_dag);
     l_dag->broadcast_disable = false;
     byte_t *l_current_round = dap_global_db_get_sync(l_gdb_group, DAG_ROUND_CURRENT_KEY, NULL, NULL, NULL);
-    l_dag->round_current = *(uint64_t *)l_current_round;
+    l_dag->round_current = l_current_round? *(uint64_t *)l_current_round : 0;
     DAP_DELETE(l_current_round);
     if ( l_dag->is_single_line ) {
         log_it (L_NOTICE, "DAG chain initialized (single line)");
-- 
GitLab