refactor: Use NodeClock::time_point for m_connected

Also, increase the precision to the native one, over prescribing second
precision.
This commit is contained in:
MarcoFalke
2026-03-20 15:52:03 +01:00
parent fa244b984c
commit fa1015bbcb
13 changed files with 57 additions and 57 deletions

View File

@@ -218,7 +218,7 @@ void ProtectEvictionCandidatesByRatio(std::vector<NodeEvictionCandidate>& evicti
// (vEvictionCandidates is already sorted by reverse connect time)
uint64_t naMostConnections;
unsigned int nMostConnections = 0;
std::chrono::seconds nMostConnectionsTime{0};
NodeClock::time_point nMostConnectionsTime{NodeClock::epoch};
std::map<uint64_t, std::vector<NodeEvictionCandidate> > mapNetGroupNodes;
for (const NodeEvictionCandidate &node : vEvictionCandidates) {
std::vector<NodeEvictionCandidate> &group = mapNetGroupNodes[node.nKeyedNetGroup];

View File

@@ -17,7 +17,7 @@ typedef int64_t NodeId;
struct NodeEvictionCandidate {
NodeId id;
std::chrono::seconds m_connected;
NodeClock::time_point m_connected;
NodeClock::duration m_min_ping_time;
std::chrono::seconds m_last_block_time;
std::chrono::seconds m_last_tx_time;