Bitcoin Core 29.99.0
P2P Digital Currency
Public Member Functions | Public Attributes | List of all members
node::TxOrphanageImpl::PeerDoSInfo Struct Reference

Public Member Functions

bool operator== (const PeerDoSInfo &other) const
 
void Add (const Announcement &ann)
 
bool Subtract (const Announcement &ann)
 
FeeFrac GetDosScore (TxOrphanage::Count max_peer_latency_score, TxOrphanage::Usage max_peer_memory) const
 There are 2 DoS scores: More...
 

Public Attributes

TxOrphanage::Usage m_total_usage {0}
 
TxOrphanage::Count m_count_announcements {0}
 
TxOrphanage::Count m_total_latency_score {0}
 

Detailed Description

Definition at line 125 of file txorphanage.cpp.

Member Function Documentation

◆ Add()

void node::TxOrphanageImpl::PeerDoSInfo::Add ( const Announcement ann)
inline

Definition at line 135 of file txorphanage.cpp.

Here is the call graph for this function:

◆ GetDosScore()

FeeFrac node::TxOrphanageImpl::PeerDoSInfo::GetDosScore ( TxOrphanage::Count  max_peer_latency_score,
TxOrphanage::Usage  max_peer_memory 
) const
inline

There are 2 DoS scores:

  • Latency score (ratio of total latency score / max allowed latency score)
  • Memory score (ratio of total memory usage / max allowed memory usage).

If the peer is using more than the allowed for either resource, its DoS score is > 1. A peer having a DoS score > 1 does not necessarily mean that something is wrong, since we do not trim unless the orphanage exceeds global limits, but it means that this peer will be selected for trimming sooner. If the global latency score or global memory usage limits are exceeded, it must be that there is a peer whose DoS score > 1.

Definition at line 161 of file txorphanage.cpp.

Here is the call graph for this function:

◆ operator==()

bool node::TxOrphanageImpl::PeerDoSInfo::operator== ( const PeerDoSInfo other) const
inline

Definition at line 129 of file txorphanage.cpp.

◆ Subtract()

bool node::TxOrphanageImpl::PeerDoSInfo::Subtract ( const Announcement ann)
inline

Definition at line 141 of file txorphanage.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ m_count_announcements

TxOrphanage::Count node::TxOrphanageImpl::PeerDoSInfo::m_count_announcements {0}

Definition at line 127 of file txorphanage.cpp.

◆ m_total_latency_score

TxOrphanage::Count node::TxOrphanageImpl::PeerDoSInfo::m_total_latency_score {0}

Definition at line 128 of file txorphanage.cpp.

◆ m_total_usage

TxOrphanage::Usage node::TxOrphanageImpl::PeerDoSInfo::m_total_usage {0}

Definition at line 126 of file txorphanage.cpp.


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