warn users about their clock if they see a consensus from the future
In router_set_networkstatus_v2() we check if the v2 ns is from the future, and warn if so:
if (ns->published_on > now + NETWORKSTATUS_ALLOW_SKEW) {
char dbuf[64];
long delta = now - ns->published_on;
format_time_interval(dbuf, sizeof(dbuf), delta);
log_warn(LD_GENERAL, "Network status from %s was published %s in the "
"future (%s GMT). Check your time and date settings! "
"Not caching.",
source_desc, dbuf, published);
control_event_general_status(LOG_WARN,
"CLOCK_SKEW MIN_SKEW=%ld SOURCE=NETWORKSTATUS:%s:%d",
delta, ns->source_address, ns->source_dirport);
skewed = 1;
}
We should do something similar for v3 consensuses.
Also, we might want to use a smaller value than '24 hours' for skew tolerance, since there's really no realistic way a consensus will validly appear from even the near future.