Merge e457513eb1 into merged_master (Bitcoin PR bitcoin/bitcoin#23631)

This commit is contained in:
Byron Hambly 2023-06-02 12:58:30 +00:00
commit 16ce576d1d

View file

@ -2734,7 +2734,11 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
int64_t nTimeOffset = nTime - GetTime();
pfrom.nTimeOffset = nTimeOffset;
AddTimeData(pfrom.addr, nTimeOffset);
if (!pfrom.IsInboundConn()) {
// Don't use timedata samples from inbound peers to make it
// harder for others to tamper with our adjusted time.
AddTimeData(pfrom.addr, nTimeOffset);
}
// If the peer is old enough to have the old alert system, send it the final alert.
if (greatest_common_version <= 70012) {