         n (count peers)]
     (if (> n 0)
       (let [all-joined-peers (set (into (keys (:pairs replica)) peers))
-            all-prepared-deps (set (keys (:prepared replica)))
-            prep-watches (set (map (fn [dep] (get (map-invert (:pairs replica)) dep)) all-prepared-deps))
-            accepting-deps (set (keys (:accepted replica)))
-            candidates (difference all-joined-peers all-prepared-deps accepting-deps prep-watches #{joiner})
+            candidates (difference all-joined-peers (disallowed-candidates replica) #{joiner})
             sorted-candidates (sort (remove nil? candidates))]
         (cond (already-joined? replica joiner)
               replica

(defn already-joined? [replica joiner]
  (some #{joiner} (:peers replica)))

(s/defmethod extensions/apply-log-entry :prepare-join-cluster :- Replica
  [{:keys [args message-id]} :- LogEntry replica]
  (let [peers (:peers replica)

   (cond ;; Handles the cases where all peers are actually dead.
         ;; This can happen if a single node cluster comes down
         ;; and is rebooted. We pick a predictably-random peer
         ;; and knock it down if it's not up. This guarantees
         ;; progress even if the cluster has experiences total failure.
         (and (= (:id state) (:subject diff)) (nil? diff))
         (let [disallowed (disallowed-candidates new)
               k (mod message-id (count disallowed))
               target (nth disallowed k)]
           (when-not (extensions/peer-exists? log target)
             (extensions/write-log-entry
              (:log state)
