 ;;;                        sendbytes
 ;;;                        sendprocessed
 ;;;                        blockfirst
+      (let [[to-drop to-keep] (split-with #(= 0 (::time %)) acked)
+            dropped-block-lengths (apply + (map ::length to-drop))
+            state (update state ::send-acked + dropped-block-lengths)
+            state (update state ::send-bytes - dropped-block-lengths)
+            state (update state ::send-processed - dropped-block-lengths)
 ;;;           177-182: Possibly set sendeofacked flag
+            state (or (when (and send-eof
+                                 (= start 0)
+                                 (> stop (+ (::send-acked state)
+                                            (::send-bytes state)))
+                                 (not send-eof-acked))
+                        (update state ::send-eof-acked true))
+                      state)]
 ;;;           183: earliestblocktime_compute()
-      )
+        (assoc state ::earliest-time (earliest-block-time blocks))))
     ;;; No change
     state))
 


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Magic constants

(def incoming
  "Number of blocks in inbound queue

  Must be a power of 2"
  64)

(def outgoing
  "Number of blocks in outbound queue

Must be a power of 2"
  128)

(def outgoing-1
  "Decremented size of outbound queue

Used w/ bitwise-and to calculate modulo and wrap circular index

Because this is used more often than outgoing"
  (dec outgoing))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Specs

  "Mark blocks between positions start and stop as ACK'd

Based [cleverly] on acknowledged, running from lines 155-185"
  [{:keys [::blocks
           ::send-acked
           ::send-bytes
           ::send-processed
           ::send-eof
           ::send-eof-acked
           ::total-block-transmissions
           ::total-blocks]
    :as state}
   start
   stop]
