Bitcoin ABC 0.30.3
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, const CChainParams &chainparams, CClientUIInterface *client_interface, int64_t default_ban_time)
 
void Ban (const CNetAddr &net_addr, int64_t ban_time_offset=0, bool since_unix_epoch=false)
 
void Ban (const CSubNet &sub_net, int64_t ban_time_offset=0, bool since_unix_epoch=false)
 
void Discourage (const CNetAddr &net_addr)
 
void ClearBanned ()
 
bool IsBanned (const CNetAddr &net_addr)
 Return whether net_addr is banned. More...
 
bool IsBanned (const CSubNet &sub_net)
 Return whether sub_net is exactly banned. More...
 
bool IsDiscouraged (const CNetAddr &net_addr)
 Return whether net_addr is discouraged. More...
 
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)
 
CRollingBloomFilter m_discouraged GUARDED_BY (m_cs_banned)
 

Private Attributes

RecursiveMutex m_cs_banned
 
CClientUIInterfacem_client_interface = nullptr
 
CBanDB m_ban_db
 
const int64_t m_default_ban_time
 

Detailed Description

Definition at line 58 of file banman.h.

Constructor & Destructor Documentation

◆ ~BanMan()

BanMan::~BanMan ( )

Definition at line 45 of file banman.cpp.

Here is the call graph for this function:

◆ BanMan()

BanMan::BanMan ( fs::path  ban_file,
const CChainParams chainparams,
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,
int64_t  ban_time_offset = 0,
bool  since_unix_epoch = false 
)

Definition at line 116 of file banman.cpp.

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

◆ Ban() [2/2]

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

Definition at line 127 of file banman.cpp.

Here is the call graph for this function:

◆ BannedSetIsDirty()

bool BanMan::BannedSetIsDirty ( )
private

Definition at line 221 of file banman.cpp.

Here is the caller graph for this function:

◆ ClearBanned()

void BanMan::ClearBanned ( )

Definition at line 70 of file banman.cpp.

Here is the call graph for this function:

◆ Discourage()

void BanMan::Discourage ( const CNetAddr net_addr)

Definition at line 122 of file banman.cpp.

Here is the call graph for this function:

◆ DumpBanlist()

void BanMan::DumpBanlist ( )

Definition at line 49 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 179 of file banman.cpp.

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

◆ GUARDED_BY() [1/3]

banmap_t m_banned BanMan::GUARDED_BY ( m_cs_banned  )
private

◆ GUARDED_BY() [2/3]

bool m_is_dirty BanMan::GUARDED_BY ( m_cs_banned  )
private

◆ GUARDED_BY() [3/3]

CRollingBloomFilter m_discouraged BanMan::GUARDED_BY ( m_cs_banned  )
inlineprivate

Definition at line 98 of file banman.h.

◆ IsBanned() [1/2]

bool BanMan::IsBanned ( const CNetAddr net_addr)

Return whether net_addr is banned.

Definition at line 89 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 ( const CSubNet sub_net)

Return whether sub_net is exactly banned.

Definition at line 103 of file banman.cpp.

Here is the call graph for this function:

◆ IsDiscouraged()

bool BanMan::IsDiscouraged ( const CNetAddr net_addr)

Return whether net_addr is discouraged.

Definition at line 84 of file banman.cpp.

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

◆ SetBanned()

void BanMan::SetBanned ( const banmap_t banmap)
private

Definition at line 187 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 226 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 193 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 157 of file banman.cpp.

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

◆ Unban() [2/2]

bool BanMan::Unban ( const CSubNet sub_net)

Definition at line 162 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 96 of file banman.h.

◆ m_client_interface

CClientUIInterface* BanMan::m_client_interface = nullptr
private

Definition at line 95 of file banman.h.

◆ m_cs_banned

RecursiveMutex BanMan::m_cs_banned
private

Definition at line 92 of file banman.h.

◆ m_default_ban_time

const int64_t BanMan::m_default_ban_time
private

Definition at line 97 of file banman.h.


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