Currently we serialize the local time when connecting to outbound connections and the “adjusted network” time when someone connects to us.
I presume the reason is to avoid a fingerprint in case the local time is misconfigured. However, the fingerprint still exits when:
- The local time goes out-of-sync after timedata is filled up, in which case the adjusted time is not adjusted. See comment in
src/timedata.cpp
. (In practise I expect no adjustment to happen after timedata is filled up by one entry more than half its size). - The local time is off by more than 70 minutes. See
DEFAULT_MAX_TIME_ADJUSTMENT
. While there is a warning in this case, the warning might be missed by the node operator. - The adjusted time is poisoned by an attacker. This is only a theoretical concern after commit e457513eb1bad11482f0820feb0f5810324a9d06.
Using the adjusted time does help in a the case where the local time is off by a constant less than 70 minutes and the node quickly connects to 5 outbound peers to retrieve the adjusted time.
Still, I think using GetAdjustedTime
here gives a false sense of security. It will be better for node operators to instead set the correct time.