Moved changes from global_db master branch to develop. Moved changes from dap_chain_global_db.c file.