Bitcoin Core  0.18.99
P2P Digital Currency
Public Member Functions | Private Member Functions | Private Attributes | List of all members
BanMan Class Reference

#include <banman.h>

Collaboration diagram for BanMan:
[legend]

Public Member Functions

 ~BanMan ()
 
 BanMan (fs::path ban_file, CClientUIInterface *client_interface, int64_t default_ban_time)
 
void Ban (const CNetAddr &net_addr, const BanReason &ban_reason, int64_t ban_time_offset=0, bool since_unix_epoch=false)
 
void Ban (const CSubNet &sub_net, const BanReason &ban_reason, int64_t ban_time_offset=0, bool since_unix_epoch=false)
 
void ClearBanned ()
 
int IsBannedLevel (CNetAddr net_addr)
 
bool IsBanned (CNetAddr net_addr)
 
bool IsBanned (CSubNet sub_net)
 
bool Unban (const CNetAddr &net_addr)
 
bool Unban (const CSubNet &sub_net)
 
void GetBanned (banmap_t &banmap)
 
void DumpBanlist ()
 

Private Member Functions

void SetBanned (const banmap_t &banmap)
 
bool BannedSetIsDirty ()
 
void SetBannedSetDirty (bool dirty=true)
 set the "dirty" flag for the banlist More...
 
void SweepBanned ()
 clean unused entries (if bantime has expired) More...
 
banmap_t m_banned GUARDED_BY (m_cs_banned)
 
bool m_is_dirty GUARDED_BY (m_cs_banned)
 

Private Attributes

CCriticalSection m_cs_banned
 
CClientUIInterfacem_client_interface = nullptr
 
CBanDB m_ban_db
 
const int64_t m_default_ban_time
 

Detailed Description

Definition at line 37 of file banman.h.

Constructor & Destructor Documentation

◆ ~BanMan()

BanMan::~BanMan ( )

Definition at line 36 of file banman.cpp.

Here is the call graph for this function:

◆ BanMan()

BanMan::BanMan ( fs::path  ban_file,
CClientUIInterface client_interface,
int64_t  default_ban_time 
)

Definition at line 14 of file banman.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ Ban() [1/2]

void BanMan::Ban ( const CNetAddr net_addr,
const BanReason ban_reason,
int64_t  ban_time_offset = 0,
bool  since_unix_epoch = false 
)

Definition at line 120 of file banman.cpp.

◆ Ban() [2/2]

void BanMan::Ban ( const CSubNet sub_net,
const BanReason ban_reason,
int64_t  ban_time_offset = 0,
bool  since_unix_epoch = false 
)

Definition at line 126 of file banman.cpp.

Here is the call graph for this function:

◆ BannedSetIsDirty()

bool BanMan::BannedSetIsDirty ( )
private

Definition at line 210 of file banman.cpp.

Here is the caller graph for this function:

◆ ClearBanned()

void BanMan::ClearBanned ( )

Definition at line 59 of file banman.cpp.

Here is the call graph for this function:

◆ DumpBanlist()

void BanMan::DumpBanlist ( )

Definition at line 41 of file banman.cpp.

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

◆ GetBanned()

void BanMan::GetBanned ( banmap_t banmap)

Definition at line 170 of file banman.cpp.

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

◆ GUARDED_BY() [1/2]

banmap_t m_banned BanMan::GUARDED_BY ( m_cs_banned  )
private

◆ GUARDED_BY() [2/2]

bool m_is_dirty BanMan::GUARDED_BY ( m_cs_banned  )
private

◆ IsBanned() [1/2]

bool BanMan::IsBanned ( CNetAddr  net_addr)

Definition at line 91 of file banman.cpp.

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

◆ IsBanned() [2/2]

bool BanMan::IsBanned ( CSubNet  sub_net)

Definition at line 106 of file banman.cpp.

Here is the call graph for this function:

◆ IsBannedLevel()

int BanMan::IsBannedLevel ( CNetAddr  net_addr)

Definition at line 70 of file banman.cpp.

Here is the call graph for this function:

◆ SetBanned()

void BanMan::SetBanned ( const banmap_t banmap)
private

Definition at line 178 of file banman.cpp.

Here is the caller graph for this function:

◆ SetBannedSetDirty()

void BanMan::SetBannedSetDirty ( bool  dirty = true)
private

set the "dirty" flag for the banlist

Definition at line 216 of file banman.cpp.

Here is the caller graph for this function:

◆ SweepBanned()

void BanMan::SweepBanned ( )
private

clean unused entries (if bantime has expired)

Definition at line 185 of file banman.cpp.

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

◆ Unban() [1/2]

bool BanMan::Unban ( const CNetAddr net_addr)

Definition at line 152 of file banman.cpp.

◆ Unban() [2/2]

bool BanMan::Unban ( const CSubNet sub_net)

Definition at line 158 of file banman.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ m_ban_db

CBanDB BanMan::m_ban_db
private

Definition at line 65 of file banman.h.

◆ m_client_interface

CClientUIInterface* BanMan::m_client_interface = nullptr
private

Definition at line 64 of file banman.h.

◆ m_cs_banned

CCriticalSection BanMan::m_cs_banned
private

Definition at line 61 of file banman.h.

◆ m_default_ban_time

const int64_t BanMan::m_default_ban_time
private

Definition at line 66 of file banman.h.


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