Bitcoin Core 31.0.0
P2P Digital Currency
Loading...
Searching...
No Matches
addrdb.cpp File Reference
#include <bitcoin-build-config.h>
#include <addrdb.h>
#include <addrman.h>
#include <chainparams.h>
#include <clientversion.h>
#include <common/args.h>
#include <common/settings.h>
#include <cstdint>
#include <hash.h>
#include <logging.h>
#include <logging/timer.h>
#include <netbase.h>
#include <netgroup.h>
#include <random.h>
#include <streams.h>
#include <tinyformat.h>
#include <univalue.h>
#include <util/fs.h>
#include <util/fs_helpers.h>
#include <util/syserror.h>
#include <util/translation.h>
Include dependency graph for addrdb.cpp:

Go to the source code of this file.

Functions

bool DumpPeerAddresses (const ArgsManager &args, const AddrMan &addr)
void ReadFromStream (AddrMan &addr, DataStream &ssPeers)
 Only used by tests.
util::Result< std::unique_ptr< AddrMan > > LoadAddrman (const NetGroupManager &netgroupman, const ArgsManager &args)
 Returns an error string on failure.
void DumpAnchors (const fs::path &anchors_db_path, const std::vector< CAddress > &anchors)
 Dump the anchor IP address database (anchors.dat).
std::vector< CAddressReadAnchors (const fs::path &anchors_db_path)
 Read the anchor IP address database (anchors.dat).

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 228 of file addrdb.cpp.

Here is the caller graph for this function:

◆ DumpPeerAddresses()

bool DumpPeerAddresses ( const ArgsManager & args,
const AddrMan & addr )

Definition at line 185 of file addrdb.cpp.

Here is the caller graph for this function:

◆ LoadAddrman()

util::Result< std::unique_ptr< AddrMan > > LoadAddrman ( const NetGroupManager & netgroupman,
const ArgsManager & args )

Returns an error string on failure.

Definition at line 196 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 234 of file addrdb.cpp.

Here is the caller graph for this function:

◆ ReadFromStream()

void ReadFromStream ( AddrMan & addr,
DataStream & ssPeers )

Only used by tests.

Definition at line 191 of file addrdb.cpp.

Here is the caller graph for this function: