More timedate changes from KMD 0.6

This commit is contained in:
Duke Leto
2020-07-09 10:31:12 -04:00
parent e959ea9768
commit d4883bce7c
12 changed files with 76 additions and 72 deletions

View File

@@ -1,4 +1,5 @@
// Copyright (c) 2012 Pieter Wuille
// Copyright (c) 2019-2020 The Hush developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
@@ -268,7 +269,7 @@ bool CAddrMan::Add_(const CAddress& addr, const CNetAddr& source, int64_t nTimeP
if (pinfo) {
// periodically update nTime
bool fCurrentlyOnline = (GetAdjustedTime() - addr.nTime < 24 * 60 * 60);
bool fCurrentlyOnline = (GetTime() - addr.nTime < 24 * 60 * 60);
int64_t nUpdateInterval = (fCurrentlyOnline ? 60 * 60 : 24 * 60 * 60);
if (addr.nTime && (!pinfo->nTime || pinfo->nTime < addr.nTime - nUpdateInterval - nTimePenalty))
pinfo->nTime = std::max((int64_t)0, addr.nTime - nTimePenalty);