[RPC] extend setban to allow subnets
This commit is contained in:
@@ -66,6 +66,7 @@ unsigned int SendBufferSize();
|
||||
void AddOneShot(const std::string& strDest);
|
||||
void AddressCurrentlyConnected(const CService& addr);
|
||||
CNode* FindNode(const CNetAddr& ip);
|
||||
CNode* FindNode(const CSubNet& subNet);
|
||||
CNode* FindNode(const std::string& addrName);
|
||||
CNode* FindNode(const CService& ip);
|
||||
CNode* ConnectNode(CAddress addrConnect, const char *pszDest = NULL);
|
||||
@@ -284,7 +285,7 @@ protected:
|
||||
|
||||
// Denial-of-service detection/prevention
|
||||
// Key is IP address, value is banned-until-time
|
||||
static std::map<CNetAddr, int64_t> setBanned;
|
||||
static std::map<CSubNet, int64_t> setBanned;
|
||||
static CCriticalSection cs_setBanned;
|
||||
|
||||
// Whitelisted ranges. Any node connecting from these is automatically
|
||||
@@ -606,9 +607,12 @@ public:
|
||||
// new code.
|
||||
static void ClearBanned(); // needed for unit testing
|
||||
static bool IsBanned(CNetAddr ip);
|
||||
static bool IsBanned(CSubNet subnet);
|
||||
static void Ban(const CNetAddr &ip, int64_t bantimeoffset = 0);
|
||||
static void Ban(const CSubNet &subNet, int64_t bantimeoffset = 0);
|
||||
static bool Unban(const CNetAddr &ip);
|
||||
static void GetBanned(std::map<CNetAddr, int64_t> &banmap);
|
||||
static bool Unban(const CSubNet &ip);
|
||||
static void GetBanned(std::map<CSubNet, int64_t> &banmap);
|
||||
|
||||
void copyStats(CNodeStats &stats);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user