diff --git a/dap-sdk b/dap-sdk index c052ecc8c04e336f65d73a9707515612103c81f2..26f3dec199f975c29b7b8c241c108065e18e16ee 160000 --- a/dap-sdk +++ b/dap-sdk @@ -1 +1 @@ -Subproject commit c052ecc8c04e336f65d73a9707515612103c81f2 +Subproject commit 26f3dec199f975c29b7b8c241c108065e18e16ee diff --git a/modules/consensus/block-pos/dap_chain_cs_block_pos.c b/modules/consensus/block-pos/dap_chain_cs_block_pos.c index 95b275c3f9809e41889643121e83bfdd761b2f39..0d714ab4f16231fa7f1116e2407e65522efedf4e 100644 --- a/modules/consensus/block-pos/dap_chain_cs_block_pos.c +++ b/modules/consensus/block-pos/dap_chain_cs_block_pos.c @@ -94,8 +94,9 @@ static int s_callback_new(dap_chain_t *a_chain, dap_config_t *a_chain_cfg) l_blocks->callback_delete = s_callback_delete; l_blocks->callback_block_verify = s_callback_block_verify; l_blocks->callback_block_sign = s_callback_block_sign; + + l_pos->_pvt = DAP_NEW_Z(dap_chain_cs_block_pos_pvt_t); dap_chain_cs_block_pos_pvt_t *l_pos_pvt = PVT(l_pos); - l_pos_pvt = DAP_NEW_Z(dap_chain_cs_block_pos_pvt_t); if (!l_pos_pvt) { log_it(L_ERROR, "Memory allocation error in %s, line %d", __PRETTY_FUNCTION__, __LINE__); goto lb_err; diff --git a/modules/consensus/dag-pos/dap_chain_cs_dag_pos.c b/modules/consensus/dag-pos/dap_chain_cs_dag_pos.c index de2c3413c9153cc94be9dcec369863546fef46e3..f315d7a2bc86b86cc28947ae11b6e8dca1756425 100644 --- a/modules/consensus/dag-pos/dap_chain_cs_dag_pos.c +++ b/modules/consensus/dag-pos/dap_chain_cs_dag_pos.c @@ -86,7 +86,6 @@ static int s_callback_new(dap_chain_t * a_chain, dap_config_t * a_chain_cfg) log_it(L_ERROR, "Memory allocation error in %s, line %d", __PRETTY_FUNCTION__, __LINE__); return -1; } - dap_chain_cs_dag_pos_pvt_t * l_pos_pvt = PVT ( l_pos ); char ** l_tokens_hold = NULL; char ** l_tokens_hold_value_str = NULL; @@ -98,7 +97,8 @@ static int s_callback_new(dap_chain_t * a_chain, dap_config_t * a_chain_cfg) l_dag->callback_cs_verify = s_callback_event_verify; l_dag->callback_cs_event_create = s_callback_event_create; l_pos->_pvt = DAP_NEW_Z ( dap_chain_cs_dag_pos_pvt_t ); - if (!l_pos->_pvt) { + dap_chain_cs_dag_pos_pvt_t *l_pos_pvt = PVT(l_pos); + if (!l_pos_pvt) { log_it(L_ERROR, "Memory allocation error in %s, line %d", __PRETTY_FUNCTION__, __LINE__); goto lb_err; } diff --git a/modules/consensus/esbocs/dap_chain_cs_esbocs.c b/modules/consensus/esbocs/dap_chain_cs_esbocs.c index ae4aad566d2459927b8b900e251da5d62bb20a8a..2e7e6cfbb31c79bfecc283de47599d9bc9a4a40a 100644 --- a/modules/consensus/esbocs/dap_chain_cs_esbocs.c +++ b/modules/consensus/esbocs/dap_chain_cs_esbocs.c @@ -180,8 +180,8 @@ static int s_callback_new(dap_chain_t *a_chain, dap_config_t *a_chain_cfg) a_chain->callback_get_minimum_fee = s_callback_get_minimum_fee; a_chain->callback_get_signing_certificate = s_callback_get_sign_key; + l_esbocs->_pvt = DAP_NEW_Z(dap_chain_esbocs_pvt_t); dap_chain_esbocs_pvt_t *l_esbocs_pvt = PVT(l_esbocs); - l_esbocs_pvt = DAP_NEW_Z(dap_chain_esbocs_pvt_t); if (!l_esbocs_pvt) { log_it(L_ERROR, "Memory allocation error in %s, line %d", __PRETTY_FUNCTION__, __LINE__); l_ret = - 5;