From 8fb1c09df1540aa3fca1148bed6a08ffc3090669 Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Tue, 27 Oct 2026 19:15:22 +0100 Subject: All OSes now do have a cheap monotonic clock, so no caching thread is needed. Also add some relative time helpers --- ot_clean.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ot_clean.c') diff --git a/ot_clean.c b/ot_clean.c index bf0504c..dbfa04e 100644 --- a/ot_clean.c +++ b/ot_clean.c @@ -46,7 +46,7 @@ static ssize_t clean_single_bucket(ot_peer *peers, size_t peer_count, size_t pee int clean_single_peer_list(ot_peerlist *peer_list, size_t peer_size) { ot_vector *peer_vector = &peer_list->peers; - time_t timedout = (time_t)(g_now_minutes - peer_list->base); + time_t timedout = (time_t)(time_now_minutes() - peer_list->base); size_t num_buckets = 1, removed_seeders = 0; /* No need to clean empty torrent */ @@ -87,11 +87,11 @@ int clean_single_peer_list(ot_peerlist *peer_list, size_t peer_size) { vector_redistribute_buckets(peer_list, peer_size); if (peer_list->peer_count) - peer_list->base = g_now_minutes; + peer_list->base = time_now_minutes(); else { /* When we got here, the last time that torrent has been touched is OT_PEER_TIMEOUT Minutes before */ - peer_list->base = g_now_minutes - OT_PEER_TIMEOUT; + peer_list->base = time_now_minutes() - OT_PEER_TIMEOUT; } return 0; } -- cgit v1.3