Added onemore check for duplicated block recieving.
Refactored task_queue into generic implementation of linked list.