diff --git a/src/or/dirserv.c b/src/or/dirserv.c index 679c169ea5..e57ec3ae56 100644 --- a/src/or/dirserv.c +++ b/src/or/dirserv.c @@ -1227,7 +1227,10 @@ static uint32_t guard_bandwidth = 0; static INLINE int real_uptime(routerinfo_t *router, time_t now) { - return router->uptime + (now - router->cache_info.published_on); + if (now < router->cache_info.published_on) + return router->uptime; + else + return router->uptime + (now - router->cache_info.published_on); } /** Return 1 if router is not suitable for these parameters, else 0.