Bitcoin Core 31.0.0
P2P Digital Currency
Loading...
Searching...
No Matches
CompareNodeNetworkTime Struct Reference

Sort eviction candidates by network/localhost and connection uptime. More...

Public Member Functions

 CompareNodeNetworkTime (bool is_local, Network network)
bool operator() (const NodeEvictionCandidate &a, const NodeEvictionCandidate &b) const

Public Attributes

const bool m_is_local
const Network m_network

Detailed Description

Sort eviction candidates by network/localhost and connection uptime.

Candidates near the beginning are more likely to be evicted, and those near the end are more likely to be protected, e.g. less likely to be evicted.

  • First, nodes that are not is_local and that do not belong to network, sorted by increasing uptime (from most recently connected to connected longer).
  • Then, nodes that are is_local or belong to network, sorted by increasing uptime.

Definition at line 64 of file eviction.cpp.

Constructor & Destructor Documentation

◆ CompareNodeNetworkTime()

CompareNodeNetworkTime::CompareNodeNetworkTime ( bool is_local,
Network network )
inline

Definition at line 67 of file eviction.cpp.

Member Function Documentation

◆ operator()()

bool CompareNodeNetworkTime::operator() ( const NodeEvictionCandidate & a,
const NodeEvictionCandidate & b ) const
inline

Definition at line 68 of file eviction.cpp.

Member Data Documentation

◆ m_is_local

const bool CompareNodeNetworkTime::m_is_local

Definition at line 65 of file eviction.cpp.

◆ m_network

const Network CompareNodeNetworkTime::m_network

Definition at line 66 of file eviction.cpp.


The documentation for this struct was generated from the following file: