P2P: add maxtimeadjustment command line option

This commit is contained in:
mruddy
2016-03-29 14:40:00 +00:00
committed by lateminer
parent a2b5a784ca
commit 3fe2f7ee04
3 changed files with 5 additions and 1 deletions

View File

@@ -83,7 +83,7 @@ void AddTimeData(const CNetAddr& ip, int64_t nOffsetSample)
int64_t nMedian = vTimeOffsets.median();
std::vector<int64_t> vSorted = vTimeOffsets.sorted();
// Only let other nodes change our time by so much
if (abs64(nMedian) < 70 * 60)
if (abs64(nMedian) <= std::max<int64_t>(0, GetArg("-maxtimeadjustment", DEFAULT_MAX_TIME_ADJUSTMENT)))
{
nTimeOffset = nMedian;
}