mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-05-29 23:33:33 +02:00
Merge bitcoin/bitcoin#34882: refactor: Use NodeClock::time_point in more places
fa1015bbcbrefactor: Use NodeClock::time_point for m_connected (MarcoFalke)fa244b984crefactor: Use NodeClock::time_point for m_last_send/recv and m_ping_start (MarcoFalke)fa2605b204refactor: Use NodeClock::time_point for CNetMessage::m_time (MarcoFalke)fa644e625brefactor: Use NodeClock::duration for m_last_ping_time/m_min_ping_time/m_ping_wait (MarcoFalke)333316f6bedoc: Fix typo "eviction criterium" -> "eviction criterion" (MarcoFalke)fa54fb0129refactor: gui: Accept up to nanoseconds in formatDurationStr, but clarify they are ignored (MarcoFalke)fab88884b7refactor: Avoid manual chrono casts with * or / (MarcoFalke)facfce37f6util: Add NodeClock::epoch alias (MarcoFalke)fa41e072b3refactor: Use NodeClock alias over deprecated GetTime (MarcoFalke) Pull request description: It is a bit confusing to have some code use the deprecated `GetTime`, which returns a duration and not a time point, and other code to use `NodeClock` time points. Fix a few more places to properly use time_point types. ACKs for top commit: stickies-v: re-ACKfa1015bbcbseduless: re-ACKfa1015bbcbnaiyoma: ACKfa1015bbcbsedited: ACKfa1015bbcbTree-SHA512: 7c8df1a9025271b08a40fd0d176bcbbf90920bc4d83a6e1c8cfaad2a894632af2b9a1aca5c3c9ddc3803e559dd168244121fd188ef22f399d60075ff194a9140
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,8 +17,8 @@ typedef int64_t NodeId;
|
||||
|
||||
struct NodeEvictionCandidate {
|
||||
NodeId id;
|
||||
std::chrono::seconds m_connected;
|
||||
std::chrono::microseconds m_min_ping_time;
|
||||
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;
|
||||
bool fRelevantServices;
|
||||
|
||||
Reference in New Issue
Block a user