Add database transaction code to blockfile handler

Updates the sqlite database with newly created blocks.