diff --git a/src/p2p_server.cpp b/src/p2p_server.cpp index 21e9489..dc558e5 100644 --- a/src/p2p_server.cpp +++ b/src/p2p_server.cpp @@ -303,7 +303,7 @@ void P2PServer::update_peer_list() }); if (result) { - client->m_lastPeerListRequestTime = std::chrono::system_clock::now(); + client->m_lastPeerListRequestTime = std::chrono::high_resolution_clock::now(); ++client->m_peerListPendingRequests; } } @@ -1255,7 +1255,7 @@ bool P2PServer::P2PClient::on_read(char* data, uint32_t size) bytes_read = 2u + num_peers * 19u; using namespace std::chrono; - m_pingTime = duration_cast(system_clock::now() - m_lastPeerListRequestTime).count(); + m_pingTime = duration_cast(high_resolution_clock::now() - m_lastPeerListRequestTime).count(); --m_peerListPendingRequests; if (!on_peer_list_response(buf + 1)) { diff --git a/src/p2p_server.h b/src/p2p_server.h index 6afe72f..c6c24f0 100644 --- a/src/p2p_server.h +++ b/src/p2p_server.h @@ -112,7 +112,7 @@ public: time_t m_prevIncomingPeerListRequest; uint64_t m_nextOutgoingPeerListRequest; - std::chrono::system_clock::time_point m_lastPeerListRequestTime; + std::chrono::high_resolution_clock::time_point m_lastPeerListRequestTime; int m_peerListPendingRequests; int64_t m_pingTime;