1
0
mirror of https://github.com/PurpleI2P/i2pd.git synced 2025-01-30 12:04:13 +00:00

don't adjust clock if time offsets are too different

This commit is contained in:
orignal 2023-12-31 14:39:59 -05:00
parent 21f41a2b2a
commit b855c71891

View File

@ -216,9 +216,14 @@ namespace transport
{ {
if (m_PendingTimeOffset) // one more if (m_PendingTimeOffset) // one more
{ {
offset = (m_PendingTimeOffset + offset)/2; // average if (std::abs (m_PendingTimeOffset - offset) < SSU2_CLOCK_SKEW)
LogPrint (eLogWarning, "SSU2: Clock adjusted by ", offset, " seconds"); {
i2p::util::AdjustTimeOffset (offset); offset = (m_PendingTimeOffset + offset)/2; // average
LogPrint (eLogWarning, "SSU2: Clock adjusted by ", offset, " seconds");
i2p::util::AdjustTimeOffset (offset);
}
else
LogPrint (eLogWarning, "SSU2: Time offsets are too different. Clock not adjusted");
m_PendingTimeOffset = 0; m_PendingTimeOffset = 0;
} }
else else