anchor.diff:  
   finish_worker(S = #state{ worker = {_WPid, WRef} }) ->
       erlang:demonitor(WRef, [flush]),
  -    S#state{ worker = undefined };
  -finish_worker(S) ->
  -    S.
  +    S#state{ worker = undefined }.
   
   start_worker(S) ->
       case aec_chain:top_block() of
  
positive.code: handle_cast(stop_generation, State) ->
      lager:debug("stop_generation"),
      {noreply, do_stop_generation(State)};
  handle_cast({new_candidate, Candidate, CandidateState}, State) ->
      %% Only publish non-empty micro-blocks
      case aec_blocks:txs(Candidate) of
          [] ->
  
negative.code: 
  update_block_candidate(Block, BlockInfo, Txs) ->
      case aec_block_micro_candidate:update(Block, Txs, BlockInfo) of
          {ok, NewBlock, NewBlockInfo} ->
              new_candidate(NewBlock, NewBlockInfo);
          {error, Reason} ->
              failed_attempt(Reason)
      end.
  
  failed_attempt(Reason) ->
      gen_server:cast(?MODULE, {worker_done, self(), {failed, Reason}}).
  
  new_candidate(NewBlock, NewBlockInfo) ->
      gen_server:cast(?MODULE, {worker_done, self(), {candidate, NewBlock, NewBlockInfo}}).
  
  publish_candidate(_Block) ->
      aec_events:publish(candidate_block, new_candidate).
  