                         first)]
     (do (swap! awaiting (partial remove #{player1}))
         (swap! match-count update-in [#{(:id player0) (:id player1)}] (fnil inc 0))
+        (async/close! (:waiter player1))
         (game-loop [player0 player1]))
-    (swap! awaiting conj player0)))
+    (let [waiter (chan)]
+      (go-loop []
+        (alt!
+          waiter :done
+          (:ch-in player0)
+          ([msg]
+           (put! (:ch-out player0)
+                 {:type :ignored :msg msg :reason "waiting for match"})
+           (recur))))
+      (swap! awaiting conj (assoc player0 :waiter waiter)))))
 
 (defn matcher-init []
   (let [ch (chan)]

    (reset! matcher ch)))

;;; Game handler
(defn game-handler [[ch-in ch-out :as chs]]
  (go-loop []
    (when-let [msg (<! ch-in)]
      (let [{:keys [type id]} msg]
        (if (and (= type "start") id)
          (let [latch (chan)]
            (>! @matcher {:id id :chs chs :latch latch})
            ;; Waits here until game ends
            (<! latch))
          (>! ch-out {:type "ignored" :msg msg}))

  (:gen-class)
  (:require
   [clojure.core
    [async :as async :refer [go go-loop <! >! chan put! alt! alts!]]]
   [taoensso.timbre :as tb]
   [manifold
    [stream :as st]
