Count peers discovered 0.19.1
authorSiraaj Khandkar <siraaj@khandkar.net>
Fri, 26 Mar 2021 13:23:50 +0000 (09:23 -0400)
committerSiraaj Khandkar <siraaj@khandkar.net>
Fri, 26 Mar 2021 13:23:50 +0000 (09:23 -0400)
info.rkt
tt.rkt

index 6e94704..ea0ad4d 100644 (file)
--- a/info.rkt
+++ b/info.rkt
@@ -6,7 +6,7 @@
 (define pkg-desc
   "twtxt client")
 (define version
-  "0.19.0")
+  "0.19.1")
 (define pkg-authors
   '("Siraaj Khandkar <siraaj@khandkar.net>"))
 (define deps
diff --git a/tt.rkt b/tt.rkt
index 2292a9a..5718783 100644 (file)
--- a/tt.rkt
+++ b/tt.rkt
                   [peers-all-prev
                     (file->peers peers-all-file)]
                   [peers-all
-                    (peers-sort (uniq (append peers
-                                              peers-mentioned
-                                              peers-all-prev)))])
+                    (list->set (append peers
+                                       peers-mentioned
+                                       peers-all-prev))]
+                  [n-peers-discovered
+                    (set-count (set-subtract peers-all
+                                             (list->set peers-all-prev)))]
+                  [peers-all
+                    (peers-sort (set->list peers-all))])
+             (log-info "Discovered ~a new peers." n-peers-discovered)
              (peers->file peers-mentioned
                           peers-mentioned-file)
              (peers->file peers-all
This page took 0.03732 seconds and 4 git commands to generate.