diff options
Diffstat (limited to 'src/peers.c')
| -rw-r--r-- | src/peers.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/peers.c b/src/peers.c index f278be2..d320e30 100644 --- a/src/peers.c +++ b/src/peers.c @@ -115,7 +115,6 @@ int add_peer(struct infohash* infohash, struct addr* peer, time_t now) { if(!entry->set) { entry->set = true; entry->key = *infohash; - entry->last_seen = now; peer_table_load++; peer_status.hashes++; prom_counter_inc(hashes, NULL); @@ -191,3 +190,11 @@ void expire_hashes(time_t now) { check_duplicates(); prom_gauge_set(current_hashes, (double)peer_table_load, NULL); } + +void peer_update_metrics() { + time_t now = time(NULL); + for(size_t i = 0; i < peer_table_size; i++) { + if(peer_table[i].set) continue; + if(now < peer_table[i].last_seen) dbg("%d was seen after now? (%ld < %ld)", i, now, peer_table[i].last_seen); + } +} |
