diff --git a/modules/chain/dap_chain_ch.c b/modules/chain/dap_chain_ch.c index 151bc63ce4836a303284e36c96a982ea36811039..2a8d8a77d79f1d099acf73b71a559a94bcf0f3af 100644 --- a/modules/chain/dap_chain_ch.c +++ b/modules/chain/dap_chain_ch.c @@ -625,6 +625,14 @@ static bool s_sync_in_chains_callback(void *a_arg) debug_if(s_debug_more, L_WARNING, "Atom with hash %s for %s:%s rejected", l_atom_hash_str, l_chain->net_name, l_chain->name); break; } + case ATOM_FORK: { + debug_if(s_debug_more, L_WARNING, "Atom with hash %s for %s:%s added to a fork branch.", l_atom_hash_str, l_chain->net_name, l_chain->name); + if (dap_chain_atom_save(l_chain->cells, l_atom, l_atom_size, NULL) < 0) + log_it(L_ERROR, "Can't save atom %s to the file", l_atom_hash_str); + else + l_ack_send = true; + break; + } default: log_it(L_CRITICAL, "Wtf is this ret code? %d", l_atom_add_res); break; diff --git a/modules/type/blocks/dap_chain_cs_blocks.c b/modules/type/blocks/dap_chain_cs_blocks.c index 6ab3531611e830a0002508de6f1e17914dbf8462..6d630a5d51bd3d10abdbf4b895ccaecc18a09db8 100644 --- a/modules/type/blocks/dap_chain_cs_blocks.c +++ b/modules/type/blocks/dap_chain_cs_blocks.c @@ -1577,7 +1577,7 @@ static dap_chain_atom_verify_res_t s_callback_atom_add(dap_chain_t * a_chain, da *l_current_branch = dap_list_append(*l_current_branch, l_block_cache); s_select_longest_branch(l_blocks, l_prev_bcache, l_current_item_index); pthread_rwlock_unlock(&PVT(l_blocks)->rwlock); - return ATOM_ACCEPT; + return ATOM_FORK; } l_forked_branches = l_forked_branches->next; }