Bitcoin Core 31.0.0
P2P Digital Currency
Loading...
Searching...
No Matches
eviction.h
Go to the documentation of this file.
1// Copyright (c) 2022-present The Bitcoin Core developers
2// Distributed under the MIT software license, see the accompanying
3// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5#ifndef BITCOIN_NODE_EVICTION_H
6#define BITCOIN_NODE_EVICTION_H
7
9#include <net_permissions.h>
10
11#include <chrono>
12#include <cstdint>
13#include <optional>
14#include <vector>
15
17
34
42[[nodiscard]] std::optional<NodeId> SelectNodeToEvict(std::vector<NodeEvictionCandidate>&& vEvictionCandidates);
43
67void ProtectEvictionCandidatesByRatio(std::vector<NodeEvictionCandidate>& vEvictionCandidates);
68
69#endif // BITCOIN_NODE_EVICTION_H
ConnectionType
Different types of connections to a peer.
std::optional< NodeId > SelectNodeToEvict(std::vector< NodeEvictionCandidate > &&vEvictionCandidates)
Select an inbound peer to evict after filtering out (protecting) peers having distinct,...
Definition eviction.cpp:178
int64_t NodeId
Definition eviction.h:16
void ProtectEvictionCandidatesByRatio(std::vector< NodeEvictionCandidate > &vEvictionCandidates)
Protect desirable or disadvantaged inbound peers from eviction by ratio.
Definition eviction.cpp:105
Network
A network type.
Definition netaddress.h:33
std::chrono::seconds m_last_tx_time
Definition eviction.h:23
std::chrono::seconds m_connected
Definition eviction.h:20
std::chrono::seconds m_last_block_time
Definition eviction.h:22
ConnectionType m_conn_type
Definition eviction.h:32
std::chrono::microseconds m_min_ping_time
Definition eviction.h:21
uint64_t nKeyedNetGroup
Definition eviction.h:27
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.
Definition time.h:73