   [state timeout]
   (d/loop [t (current-time)]
     (when-not (empty? (:tx-queue @state))
-      (transmit state))
+      (transmit! state))
 
     (if-not (stream-open? (:rx-stream @state))
       (warn (:id @state) " has a closed stream we should be exiting")

        (d/catch (fn [ex]
                   (warn (:id state) "caught exception in connecting to: " id))))))

(defn- reconnect-to-peer [state peer-id]
  (when-not (get-in @state [:peers peer-id :connect-pending])
    (swap! state assoc-in [:peers peer-id :connect-pending] true)
    (warn (:id @state) " reconnecting to " peer-id)

  (d/chain (tcp/client {:host host, :port port})
           #(wrap-duplex-stream protocol %)))

(defn- connect-peer-socket!
  "Connects the peer messages to the :rx-stream"
  [state socket handshake]
  (info (:id @state) " accepting peer connection from: " (:src handshake))
