mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-05-12 15:03:18 +02:00
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:
@@ -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];
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user