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

Public Member Functions

 AddrManTest (bool makeDeterministic=true, std::vector< bool > asmap=std::vector< bool >())
 
AddrInfoFind (const CNetAddr &addr, int *pnId=nullptr)
 
AddrInfoCreate (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 AddrMan
 AddrMan (std::vector< bool > asmap, bool deterministic, int32_t consistency_check_ratio)
 
 ~AddrMan ()
 
template<typename Stream >
void Serialize (Stream &s_) const
 
template<typename Stream >
void Unserialize (Stream &s_)
 
size_t size () const
 Return the number of (unique) addresses in all tables. More...
 
bool Add (const std::vector< CAddress > &vAddr, const CNetAddr &source, int64_t nTimePenalty=0)
 Add addresses to addrman's new table. More...
 
void Good (const CService &addr, int64_t nTime=GetAdjustedTime())
 Mark an entry as accessible, possibly moving it from "new" to "tried". More...
 
void Attempt (const CService &addr, bool fCountFailure, int64_t nTime=GetAdjustedTime())
 Mark an entry as connection attempted to. More...
 
void ResolveCollisions ()
 See if any to-be-evicted tried table entries have been tested and if so resolve the collisions. More...
 
std::pair< CAddress, int64_t > SelectTriedCollision ()
 Randomly select an address in the tried table that another address is attempting to evict. More...
 
std::pair< CAddress, int64_t > Select (bool newOnly=false) const
 Choose an address to connect to. More...
 
std::vector< CAddressGetAddr (size_t max_addresses, size_t max_pct, std::optional< Network > network) const
 Return all or many randomly selected addresses, optionally by network. More...
 
void Connected (const CService &addr, int64_t nTime=GetAdjustedTime())
 We have successfully connected to this peer. More...
 
void SetServices (const CService &addr, ServiceFlags nServices)
 Update an entry's service bits. More...
 
const std::vector< bool > & GetAsmap () const
 

Private Attributes

bool deterministic
 

Detailed Description

Definition at line 80 of file addrman_tests.cpp.

Constructor & Destructor Documentation

◆ AddrManTest()

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

Definition at line 85 of file addrman_tests.cpp.

Member Function Documentation

◆ Create()

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

Definition at line 98 of file addrman_tests.cpp.

Here is the caller graph for this function:

◆ Delete()

void AddrManTest::Delete ( int  nId)
inline

Definition at line 104 of file addrman_tests.cpp.

Here is the caller graph for this function:

◆ Find()

AddrInfo* AddrManTest::Find ( const CNetAddr addr,
int *  pnId = nullptr 
)
inline

Definition at line 92 of file addrman_tests.cpp.

Here is the caller graph for this function:

◆ GetBucketAndEntry()

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

Definition at line 111 of file addrman_tests.cpp.

◆ SimConnFail()

void AddrManTest::SimConnFail ( const CService addr)
inline

Definition at line 126 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 AddrManTest::deterministic
private

Definition at line 83 of file addrman_tests.cpp.


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