Bitcoin ABC  0.26.3
P2P Digital Currency
Public Member Functions | Public Attributes | Protected Member Functions | Private Attributes | List of all members
CAddrDb Class Reference

#include <db.h>

Collaboration diagram for CAddrDb:
[legend]

Public Member Functions

void GetStats (CAddrDbStats &stats) const
 
void ResetIgnores ()
 
std::vector< CAddrReportGetAll ()
 
template<typename Stream >
void Serialize (Stream &s) const
 
template<typename Stream >
void Unserialize (Stream &s)
 
void Add (const CAddress &addr, bool fForce=false)
 
void Add (const std::vector< CAddress > &vAddr, bool fForce=false)
 
void GetMany (std::vector< CServiceResult > &ips, int max, int &wait)
 
void ResultMany (const std::vector< CServiceResult > &ips)
 
void GetIPs (std::set< CNetAddr > &ips, uint64_t requestedFlags, uint32_t max, const bool *nets)
 

Public Attributes

std::map< CService, int64_t > banned
 

Protected Member Functions

void Add_ (const CAddress &addr, bool force)
 
bool Get_ (CServiceResult &ip, int &wait)
 
void Good_ (const CService &ip, int clientV, std::string clientSV, int blocks, uint64_t services)
 
void Bad_ (const CService &ip, int ban)
 
int Lookup_ (const CService &ip)
 
void GetIPs_ (std::set< CNetAddr > &ips, uint64_t requestedFlags, uint32_t max, const bool *nets)
 

Private Attributes

RecursiveMutex cs
 
int nId
 
std::map< int, SeederAddrInfoidToInfo
 
std::map< CService, int > ipToId
 
std::deque< int > ourId
 
std::set< int > unkId
 
std::set< int > goodId
 
int nDirty
 

Detailed Description

        seen nodes
       /          \

(a) banned nodes available nodes-----------— / | \ tracked nodes (b) unknown nodes (e) active nodes / \ (d) good nodes (c) non-good nodes

Definition at line 264 of file db.h.

Member Function Documentation

◆ Add() [1/2]

void CAddrDb::Add ( const CAddress addr,
bool  fForce = false 
)
inline

Definition at line 400 of file db.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Add() [2/2]

void CAddrDb::Add ( const std::vector< CAddress > &  vAddr,
bool  fForce = false 
)
inline

Definition at line 405 of file db.h.

Here is the call graph for this function:

◆ Add_()

void CAddrDb::Add_ ( const CAddress addr,
bool  force 
)
protected

Definition at line 146 of file db.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Bad_()

void CAddrDb::Bad_ ( const CService ip,
int  ban 
)
protected

info.IsReliable() &&

Definition at line 112 of file db.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Get_()

bool CAddrDb::Get_ ( CServiceResult ip,
int &  wait 
)
protected

Definition at line 44 of file db.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetAll()

std::vector<CAddrReport> CAddrDb::GetAll ( )
inline

Definition at line 324 of file db.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetIPs()

void CAddrDb::GetIPs ( std::set< CNetAddr > &  ips,
uint64_t  requestedFlags,
uint32_t  max,
const bool *  nets 
)
inline

Definition at line 436 of file db.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetIPs_()

void CAddrDb::GetIPs_ ( std::set< CNetAddr > &  ips,
uint64_t  requestedFlags,
uint32_t  max,
const bool *  nets 
)
protected

Definition at line 192 of file db.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetMany()

void CAddrDb::GetMany ( std::vector< CServiceResult > &  ips,
int  max,
int &  wait 
)
inline

Definition at line 412 of file db.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetStats()

void CAddrDb::GetStats ( CAddrDbStats stats) const
inline

Definition at line 303 of file db.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Good_()

void CAddrDb::Good_ ( const CService ip,
int  clientV,
std::string  clientSV,
int  blocks,
uint64_t  services 
)
protected

Definition at line 89 of file db.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Lookup_()

int CAddrDb::Lookup_ ( const CService ip)
protected

Definition at line 82 of file db.cpp.

Here is the caller graph for this function:

◆ ResetIgnores()

void CAddrDb::ResetIgnores ( )
inline

Definition at line 317 of file db.h.

Here is the caller graph for this function:

◆ ResultMany()

void CAddrDb::ResultMany ( const std::vector< CServiceResult > &  ips)
inline

Definition at line 424 of file db.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Serialize()

template<typename Stream >
void CAddrDb::Serialize ( Stream &  s) const
inline

Definition at line 346 of file db.h.

◆ Unserialize()

template<typename Stream >
void CAddrDb::Unserialize ( Stream &  s)
inline

Definition at line 368 of file db.h.

Here is the call graph for this function:

Member Data Documentation

◆ banned

std::map<CService, int64_t> CAddrDb::banned

Definition at line 301 of file db.h.

◆ cs

RecursiveMutex CAddrDb::cs
mutableprivate

Definition at line 266 of file db.h.

◆ goodId

std::set<int> CAddrDb::goodId
private

Definition at line 278 of file db.h.

◆ idToInfo

std::map<int, SeederAddrInfo> CAddrDb::idToInfo
private

Definition at line 270 of file db.h.

◆ ipToId

std::map<CService, int> CAddrDb::ipToId
private

Definition at line 272 of file db.h.

◆ nDirty

int CAddrDb::nDirty
private

Definition at line 279 of file db.h.

◆ nId

int CAddrDb::nId
private

Definition at line 268 of file db.h.

◆ ourId

std::deque<int> CAddrDb::ourId
private

Definition at line 274 of file db.h.

◆ unkId

std::set<int> CAddrDb::unkId
private

Definition at line 276 of file db.h.


The documentation for this class was generated from the following files: