Changeset View
Changeset View
Standalone View
Standalone View
src/banman.h
Show First 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | |||||
// policy check so the transaction is accepted, then that transaction could | // policy check so the transaction is accepted, then that transaction could | ||||
// cause the network to split between old nodes and new nodes. | // cause the network to split between old nodes and new nodes. | ||||
class BanMan { | class BanMan { | ||||
public: | public: | ||||
~BanMan(); | ~BanMan(); | ||||
BanMan(fs::path ban_file, const CChainParams &chainparams, | BanMan(fs::path ban_file, const CChainParams &chainparams, | ||||
CClientUIInterface *client_interface, int64_t default_ban_time); | CClientUIInterface *client_interface, int64_t default_ban_time); | ||||
void Ban(const CNetAddr &net_addr, const BanReason &ban_reason, | void Ban(const CNetAddr &net_addr, int64_t ban_time_offset = 0, | ||||
int64_t ban_time_offset = 0, bool since_unix_epoch = false); | bool since_unix_epoch = false); | ||||
void Ban(const CSubNet &sub_net, const BanReason &ban_reason, | void Ban(const CSubNet &sub_net, int64_t ban_time_offset = 0, | ||||
int64_t ban_time_offset = 0, bool since_unix_epoch = false); | bool since_unix_epoch = false); | ||||
void Discourage(const CNetAddr &net_addr); | |||||
void ClearBanned(); | void ClearBanned(); | ||||
int IsBannedLevel(CNetAddr net_addr); | |||||
bool IsBanned(CNetAddr net_addr); | //! Return whether net_addr is banned | ||||
bool IsBanned(CSubNet sub_net); | bool IsBanned(const CNetAddr &net_addr); | ||||
//! Return whether sub_net is exactly banned | |||||
bool IsBanned(const CSubNet &sub_net); | |||||
//! Return whether net_addr is discouraged. | |||||
bool IsDiscouraged(const CNetAddr &net_addr); | |||||
bool Unban(const CNetAddr &net_addr); | bool Unban(const CNetAddr &net_addr); | ||||
bool Unban(const CSubNet &sub_net); | bool Unban(const CSubNet &sub_net); | ||||
void GetBanned(banmap_t &banmap); | void GetBanned(banmap_t &banmap); | ||||
void DumpBanlist(); | void DumpBanlist(); | ||||
private: | private: | ||||
void SetBanned(const banmap_t &banmap); | void SetBanned(const banmap_t &banmap); | ||||
bool BannedSetIsDirty(); | bool BannedSetIsDirty(); | ||||
Show All 15 Lines |