From: Siraaj Khandkar Date: Fri, 26 Mar 2021 13:23:50 +0000 (-0400) Subject: Count peers discovered X-Git-Tag: 0.19.1 X-Git-Url: https://git.xandkar.net/?a=commitdiff_plain;h=018b2abb4e198464e0962de8ed9b1da4d6b91a20;p=tt.git Count peers discovered --- diff --git a/info.rkt b/info.rkt index 6e94704..ea0ad4d 100644 --- 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 ")) (define deps diff --git a/tt.rkt b/tt.rkt index 2292a9a..5718783 100644 --- a/tt.rkt +++ b/tt.rkt @@ -635,9 +635,15 @@ [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