Bitcoin ABC 0.32.5
P2P Digital Currency
Public Member Functions | Private Attributes | Static Private Attributes | List of all members
CBanDB Class Reference

Access to the banlist databases (banlist.json and banlist.dat) More...

#include <addrdb.h>

Collaboration diagram for CBanDB:
[legend]

Public Member Functions

 CBanDB (fs::path ban_list_path, const CChainParams &_chainParams)
 
bool Write (const banmap_t &banSet)
 
bool Read (banmap_t &banSet, bool &dirty)
 Read the banlist from disk. More...
 

Private Attributes

const fs::path m_banlist_dat
 
const fs::path m_banlist_json
 
const CChainParamschainParams
 

Static Private Attributes

static constexpr const char * JSON_KEY = "banned_nets"
 JSON key under which the data is stored in the json database. More...
 

Detailed Description

Access to the banlist databases (banlist.json and banlist.dat)

Definition at line 74 of file addrdb.h.

Constructor & Destructor Documentation

◆ CBanDB()

CBanDB::CBanDB ( fs::path  ban_list_path,
const CChainParams _chainParams 
)

Definition at line 199 of file addrdb.cpp.

Member Function Documentation

◆ Read()

bool CBanDB::Read ( banmap_t banSet,
bool &  dirty 
)

Read the banlist from disk.

Parameters
[out]banSetThe loaded list. Set if true is returned, otherwise it is left in an undefined state.
[out]dirtyIndicates whether the loaded list needs flushing to disk. Set if true is returned, otherwise it is left in an undefined state.
Returns
true on success

Definition at line 216 of file addrdb.cpp.

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

◆ Write()

bool CBanDB::Write ( const banmap_t banSet)

Definition at line 203 of file addrdb.cpp.

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

Member Data Documentation

◆ chainParams

const CChainParams& CBanDB::chainParams
private

Definition at line 83 of file addrdb.h.

◆ JSON_KEY

constexpr const char* CBanDB::JSON_KEY = "banned_nets"
staticconstexprprivate

JSON key under which the data is stored in the json database.

Definition at line 79 of file addrdb.h.

◆ m_banlist_dat

const fs::path CBanDB::m_banlist_dat
private

Definition at line 81 of file addrdb.h.

◆ m_banlist_json

const fs::path CBanDB::m_banlist_json
private

Definition at line 82 of file addrdb.h.


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