diff options
author | MarcoFalke <falke.marco@gmail.com> | 2022-03-24 19:56:00 +0100 |
---|---|---|
committer | MacroFake <falke.marco@gmail.com> | 2022-07-30 11:04:09 +0200 |
commit | fadd8b2676f6d68ec87189871461c9a6a6aa3cac (patch) | |
tree | cdb4586d8b54b58eea184a13fbe2d75ded74193c /src/net.cpp | |
parent | ab3db34836b157fe9a2196989a4d290c714bddc3 (diff) |
addrman: Use system time instead of adjusted network time
Diffstat (limited to 'src/net.cpp')
-rw-r--r-- | src/net.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/net.cpp b/src/net.cpp index c4aaac4986..e87ac079b5 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -454,7 +454,7 @@ CNode* CConnman::ConnectNode(CAddress addrConnect, const char *pszDest, bool fCo LogPrintLevel(BCLog::NET, BCLog::Level::Debug, "trying connection %s lastseen=%.1fhrs\n", pszDest ? pszDest : addrConnect.ToString(), - Ticks<HoursDouble>(pszDest ? 0h : AdjustedTime() - addrConnect.nTime)); + Ticks<HoursDouble>(pszDest ? 0h : Now<NodeSeconds>() - addrConnect.nTime)); // Resolve const uint16_t default_port{pszDest != nullptr ? Params().GetDefaultPort(pszDest) : @@ -1735,7 +1735,7 @@ void CConnman::ThreadOpenConnections(const std::vector<std::string> connect) addrman.ResolveCollisions(); - const auto nANow{AdjustedTime()}; + const auto current_time{NodeClock::now()}; int nTries = 0; while (!interruptNet) { @@ -1798,7 +1798,7 @@ void CConnman::ThreadOpenConnections(const std::vector<std::string> connect) continue; // only consider very recently tried nodes after 30 failed attempts - if (nANow - addr_last_try < 10min && nTries < 30) { + if (current_time - addr_last_try < 10min && nTries < 30) { continue; } |