Litecoin: Reduce amount that peers can adjust our time to eliminate an attack vector.

This commit is contained in:
coblee 2011-10-28 20:34:19 -10:00 committed by Warren Togami
parent 2db43142bc
commit 5e17fcb020

View File

@ -1318,7 +1318,7 @@ void AddTimeData(const CNetAddr& ip, int64 nTime)
int64 nMedian = vTimeOffsets.median();
std::vector<int64> vSorted = vTimeOffsets.sorted();
// Only let other nodes change our time by so much
if (abs64(nMedian) < 70 * 60)
if (abs64(nMedian) < 35 * 60) // Litecoin: changed maximum adjust to 35 mins to avoid letting peers change our time too much in case of an attack.
{
nTimeOffset = nMedian;
}