Browse Source

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

0.8
coblee 13 years ago committed by Warren Togami
parent
commit
5e17fcb020
  1. 2
      src/util.cpp

2
src/util.cpp

@ -1318,7 +1318,7 @@ void AddTimeData(const CNetAddr& ip, int64 nTime) @@ -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;
}

Loading…
Cancel
Save