Bitcoin Core  22.99.0
P2P Digital Currency
Classes | Functions
addrdb.h File Reference
#include <fs.h>
#include <net_types.h>
#include <univalue.h>
#include <optional>
#include <vector>
Include dependency graph for addrdb.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  CBanDB
 Access to the banlist database (banlist.json) More...
 

Functions

bool DumpPeerAddresses (const ArgsManager &args, const CAddrMan &addr)
 
void ReadFromStream (CAddrMan &addr, CDataStream &ssPeers)
 Only used by tests. More...
 
std::optional< bilingual_strLoadAddrman (const std::vector< bool > &asmap, const ArgsManager &args, std::unique_ptr< CAddrMan > &addrman)
 Returns an error string on failure. More...
 
void DumpAnchors (const fs::path &anchors_db_path, const std::vector< CAddress > &anchors)
 Dump the anchor IP address database (anchors.dat) More...
 
std::vector< CAddressReadAnchors (const fs::path &anchors_db_path)
 Read the anchor IP address database (anchors.dat) More...
 

Function Documentation

◆ DumpAnchors()

void DumpAnchors ( const fs::path &  anchors_db_path,
const std::vector< CAddress > &  anchors 
)

Dump the anchor IP address database (anchors.dat)

Anchors are last known outgoing block-relay-only peers that are tried to re-connect to on startup.

Definition at line 207 of file addrdb.cpp.

Here is the caller graph for this function:

◆ DumpPeerAddresses()

bool DumpPeerAddresses ( const ArgsManager args,
const CAddrMan addr 
)

Definition at line 173 of file addrdb.cpp.

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

◆ LoadAddrman()

std::optional<bilingual_str> LoadAddrman ( const std::vector< bool > &  asmap,
const ArgsManager args,
std::unique_ptr< CAddrMan > &  addrman 
)

Returns an error string on failure.

Definition at line 184 of file addrdb.cpp.

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

◆ ReadAnchors()

std::vector<CAddress> ReadAnchors ( const fs::path &  anchors_db_path)

Read the anchor IP address database (anchors.dat)

Deleting anchors.dat is intentional as it avoids renewed peering to anchors after an unclean shutdown and thus potential exploitation of the anchor peer policy.

Definition at line 213 of file addrdb.cpp.

Here is the caller graph for this function:

◆ ReadFromStream()

void ReadFromStream ( CAddrMan addr,
CDataStream ssPeers 
)

Only used by tests.

Definition at line 179 of file addrdb.cpp.

Here is the caller graph for this function: