Bitcoin Core  22.99.0
P2P Digital Currency
Public Member Functions | Private Attributes | List of all members
CAddrManTest Class Reference
Inheritance diagram for CAddrManTest:
[legend]
Collaboration diagram for CAddrManTest:
[legend]

Public Member Functions

 CAddrManTest (bool makeDeterministic=true, std::vector< bool > asmap=std::vector< bool >())
 
CAddrInfoFind (const CNetAddr &addr, int *pnId=nullptr)
 
CAddrInfoCreate (const CAddress &addr, const CNetAddr &addrSource, int *pnId=nullptr)
 
void Delete (int nId)
 
std::pair< int, int > GetBucketAndEntry (const CAddress &addr)
 
void SimConnFail (const CService &addr)
 
- Public Member Functions inherited from CAddrMan
template<typename Stream >
void Serialize (Stream &s_) const EXCLUSIVE_LOCKS_REQUIRED(!cs)
 
template<typename Stream >
void Unserialize (Stream &s_) EXCLUSIVE_LOCKS_REQUIRED(!cs)
 
 CAddrMan (std::vector< bool > asmap, bool deterministic, int32_t consistency_check_ratio)
 
 ~CAddrMan ()
 
size_t size () const EXCLUSIVE_LOCKS_REQUIRED(!cs)
 Return the number of (unique) addresses in all tables. More...
 
bool Add (const std::vector< CAddress > &vAddr, const CNetAddr &source, int64_t nTimePenalty=0) EXCLUSIVE_LOCKS_REQUIRED(!cs)
 Add addresses to addrman's new table. More...
 
void Good (const CService &addr, int64_t nTime=GetAdjustedTime()) EXCLUSIVE_LOCKS_REQUIRED(!cs)
 Mark an entry as accessible. More...
 
void Attempt (const CService &addr, bool fCountFailure, int64_t nTime=GetAdjustedTime()) EXCLUSIVE_LOCKS_REQUIRED(!cs)
 Mark an entry as connection attempted to. More...
 
void ResolveCollisions () EXCLUSIVE_LOCKS_REQUIRED(!cs)
 See if any to-be-evicted tried table entries have been tested and if so resolve the collisions. More...
 
CAddrInfo SelectTriedCollision () EXCLUSIVE_LOCKS_REQUIRED(!cs)
 Randomly select an address in tried that another address is attempting to evict. More...
 
CAddrInfo Select (bool newOnly=false) const EXCLUSIVE_LOCKS_REQUIRED(!cs)
 Choose an address to connect to. More...
 
std::vector< CAddressGetAddr (size_t max_addresses, size_t max_pct, std::optional< Network > network) const EXCLUSIVE_LOCKS_REQUIRED(!cs)
 Return all or many randomly selected addresses, optionally by network. More...
 
void Connected (const CService &addr, int64_t nTime=GetAdjustedTime()) EXCLUSIVE_LOCKS_REQUIRED(!cs)
 Outer function for Connected_() More...
 
void SetServices (const CService &addr, ServiceFlags nServices) EXCLUSIVE_LOCKS_REQUIRED(!cs)
 
const std::vector< bool > & GetAsmap () const
 

Private Attributes

bool deterministic
 

Detailed Description

Definition at line 79 of file addrman_tests.cpp.

Constructor & Destructor Documentation

◆ CAddrManTest()

CAddrManTest::CAddrManTest ( bool  makeDeterministic = true,
std::vector< bool >  asmap = std::vector<bool>() 
)
inlineexplicit

Definition at line 84 of file addrman_tests.cpp.

Member Function Documentation

◆ Create()

CAddrInfo* CAddrManTest::Create ( const CAddress addr,
const CNetAddr addrSource,
int *  pnId = nullptr 
)
inline

Definition at line 97 of file addrman_tests.cpp.

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

◆ Delete()

void CAddrManTest::Delete ( int  nId)
inline

Definition at line 103 of file addrman_tests.cpp.

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

◆ Find()

CAddrInfo* CAddrManTest::Find ( const CNetAddr addr,
int *  pnId = nullptr 
)
inline

Definition at line 91 of file addrman_tests.cpp.

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

◆ GetBucketAndEntry()

std::pair<int, int> CAddrManTest::GetBucketAndEntry ( const CAddress addr)
inline

Definition at line 110 of file addrman_tests.cpp.

◆ SimConnFail()

void CAddrManTest::SimConnFail ( const CService addr)
inline

Definition at line 125 of file addrman_tests.cpp.

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

Member Data Documentation

◆ deterministic

bool CAddrManTest::deterministic
private

Definition at line 82 of file addrman_tests.cpp.


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