anchor.diff:      end, JobNodes),
       State#state{job_nodes = JobNodes2}.
   
  +maybe_finished_voting(#state{job_nodes = JobNodes} = State) ->
  +    case count_nodes_in_state([new], State) of
  +        0 ->
  +            NumNodes = dict:size(JobNodes),
  +            case count_nodes_in_state([ready], State) of
  +                NumNodes -> start_running(State);
  +                _ -> finish_job(quorum_failed, State)
  +            end;
  +        _ -> {next_state, voting, State}
  +    end.
  +
   maybe_finished_running(State) ->
       case count_nodes_in_state([ready, running], State) of
           0 -> finish_job(complete, State);
  
positive.code:     State2 = mark_node_faulty(NodeRef, State),
      maybe_finished_voting(State2).
  
  maybe_finished_voting(#state{job_nodes = JobNodes} = State) ->
      case count_nodes_in_state([new], State) of
          0 ->
              NumNodes = dict:size(JobNodes),
              case count_nodes_in_state([ready], State) of
                  NumNodes -> start_running(State);
                  _ -> finish_job(quorum_failed, State)
              end;
          _ -> {next_state, voting, State}
      end.
  
  running({ack_run, NodeRef}, State) ->
      % Node from ready -> running
      case get_node_state(NodeRef, State) of
          ready ->
              State2 = set_node_state(NodeRef, running, State),
              {next_state, running, State2};
          running -> {next_state, running, State};
          _ ->
              State2 = mark_node_faulty(NodeRef, State),
              maybe_finished_running(State2)
      end;
  running({complete, NodeRef}, State) ->
      State2 = case get_node_state(NodeRef, State) of
          running -> set_node_state(NodeRef, complete, State);
  
negative.code:                 job = Job#pushy_job{job_nodes = undefined},
                  job_nodes = JobNodes
              },
              listen_for_down_nodes(dict:fetch_keys(JobNodes)),
  
              % Start voting--if there are no nodes, the job finishes immediately.
              start_voting(State);
          false ->
              {stop, shutdown, undefined}
      end.
  