~edwargix/tallyard

922e4bcca6655d4ad378461503e61f57d715cae2 — David Florness 5 years ago 8a03500
Add command to list peers who need to commit
1 files changed, 10 insertions(+), 0 deletions(-)

M bulletin.rkt
M bulletin.rkt => bulletin.rkt +10 -0
@@ 293,5 293,15 @@
                             (hash-remove! _peers token)))
                         (displayln "close the election first"))]
              ['state (displayln (symbol->string state))]
              ['waiting
               (displayln
                (set-map
                 (for/set ([p (hash-values _peers)]
                           #:when (not (hash-has-key? _commits (hash-ref p 'input))))
                   (hash-ref p 'input))
                 (λ (input)
                   (for/first ([(k v) _peers]
                               #:when (equal? (hash-ref v 'input) input))
                     (hash-ref v 'username)))))]
              [else (displayln "unknown command")])
            (loop)))))))