Be smarter about launching connections to authorities to learn about clock skew
While applying altf4's code related to bug1074, some possible enhancements came up. They wouldn't be too hard to do.
Right now, we notice clock skew for two reasons: a time from a netinfo cell is different from ours, and a time in an HTTP response header is different from ours. In the netinfo case, if the skew came from an authority, we believe it. If not, and we haven't gotten a netinfo from an authority, we launch an OR connection to an authority.
In fact, we should be a bit more sophisticated:
- Any authenticated time from an authority should count as "hearing the time from an authority". This includes not only netinfo cells but also authenticated directory connections.
- Maybe, skew information from regular HTTP responses should also count as "hearing that we are skewed from a non-authority".
- Instead of keeping track of whether we've heard the correct time from an authority, we should keep track of when we heard from the authority. In other words, if we last heard about the correct time from an authority an hour ago and somebody else disagrees with them, the authority is probably right. But if we last heard about the correct time a week ago, we might want to ask again.