Bitcoin Core 31.0.0
P2P Digital Currency
Loading...
Searching...
No Matches
CBanDB Class Reference

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

#include <addrdb.h>

Public Member Functions

 CBanDB (fs::path ban_list_path)
bool Write (const banmap_t &banSet)
bool Read (banmap_t &banSet)
 Read the banlist from disk.

Private Attributes

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

Static Private Attributes

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

Detailed Description

Access to the banlist database (banlist.json).

Definition at line 28 of file addrdb.h.

Constructor & Destructor Documentation

◆ CBanDB()

CBanDB::CBanDB ( fs::path ban_list_path)
explicit

Definition at line 136 of file addrdb.cpp.

Member Function Documentation

◆ Read()

bool CBanDB::Read ( banmap_t & banSet)

Read the banlist from disk.

Parameters
[out]banSetThe loaded list. Set if true is returned, otherwise it is left in an undefined state.
Returns
true on success

Definition at line 155 of file addrdb.cpp.

Here is the call graph for this function:

◆ Write()

bool CBanDB::Write ( const banmap_t & banSet)

Definition at line 142 of file addrdb.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ JSON_KEY

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

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

Definition at line 34 of file addrdb.h.

◆ m_banlist_dat

const fs::path CBanDB::m_banlist_dat
private

Definition at line 36 of file addrdb.h.

◆ m_banlist_json

const fs::path CBanDB::m_banlist_json
private

Definition at line 37 of file addrdb.h.


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