|
|
@ -169,6 +169,7 @@ public: |
|
|
|
bool DisconnectNode(NodeId id); |
|
|
|
bool DisconnectNode(NodeId id); |
|
|
|
bool DisconnectSubnet(const CSubNet& subnet); |
|
|
|
bool DisconnectSubnet(const CSubNet& subnet); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void AddWhitelistedRange(const CSubNet &subnet); |
|
|
|
private: |
|
|
|
private: |
|
|
|
struct ListenSocket { |
|
|
|
struct ListenSocket { |
|
|
|
SOCKET socket; |
|
|
|
SOCKET socket; |
|
|
@ -192,6 +193,8 @@ private: |
|
|
|
|
|
|
|
|
|
|
|
bool AttemptToEvictConnection(); |
|
|
|
bool AttemptToEvictConnection(); |
|
|
|
CNode* ConnectNode(CAddress addrConnect, const char *pszDest, bool fCountFailure); |
|
|
|
CNode* ConnectNode(CAddress addrConnect, const char *pszDest, bool fCountFailure); |
|
|
|
|
|
|
|
bool IsWhitelistedRange(const CNetAddr &addr); |
|
|
|
|
|
|
|
|
|
|
|
void DeleteNode(CNode* pnode); |
|
|
|
void DeleteNode(CNode* pnode); |
|
|
|
//!check is the banlist has unwritten changes
|
|
|
|
//!check is the banlist has unwritten changes
|
|
|
|
bool BannedSetIsDirty(); |
|
|
|
bool BannedSetIsDirty(); |
|
|
@ -203,6 +206,11 @@ private: |
|
|
|
void DumpData(); |
|
|
|
void DumpData(); |
|
|
|
void DumpBanlist(); |
|
|
|
void DumpBanlist(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Whitelisted ranges. Any node connecting from these is automatically
|
|
|
|
|
|
|
|
// whitelisted (as well as those connecting to whitelisted binds).
|
|
|
|
|
|
|
|
std::vector<CSubNet> vWhitelistedRange; |
|
|
|
|
|
|
|
CCriticalSection cs_vWhitelistedRange; |
|
|
|
|
|
|
|
|
|
|
|
std::vector<ListenSocket> vhListenSocket; |
|
|
|
std::vector<ListenSocket> vhListenSocket; |
|
|
|
banmap_t setBanned; |
|
|
|
banmap_t setBanned; |
|
|
|
CCriticalSection cs_setBanned; |
|
|
|
CCriticalSection cs_setBanned; |
|
|
@ -432,11 +440,6 @@ public: |
|
|
|
const uint64_t nKeyedNetGroup; |
|
|
|
const uint64_t nKeyedNetGroup; |
|
|
|
protected: |
|
|
|
protected: |
|
|
|
|
|
|
|
|
|
|
|
// Whitelisted ranges. Any node connecting from these is automatically
|
|
|
|
|
|
|
|
// whitelisted (as well as those connecting to whitelisted binds).
|
|
|
|
|
|
|
|
static std::vector<CSubNet> vWhitelistedRange; |
|
|
|
|
|
|
|
static CCriticalSection cs_vWhitelistedRange; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mapMsgCmdSize mapSendBytesPerMsgCmd; |
|
|
|
mapMsgCmdSize mapSendBytesPerMsgCmd; |
|
|
|
mapMsgCmdSize mapRecvBytesPerMsgCmd; |
|
|
|
mapMsgCmdSize mapRecvBytesPerMsgCmd; |
|
|
|
|
|
|
|
|
|
|
@ -803,9 +806,6 @@ public: |
|
|
|
|
|
|
|
|
|
|
|
void copyStats(CNodeStats &stats); |
|
|
|
void copyStats(CNodeStats &stats); |
|
|
|
|
|
|
|
|
|
|
|
static bool IsWhitelistedRange(const CNetAddr &ip); |
|
|
|
|
|
|
|
static void AddWhitelistedRange(const CSubNet &subnet); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Network stats
|
|
|
|
// Network stats
|
|
|
|
static void RecordBytesRecv(uint64_t bytes); |
|
|
|
static void RecordBytesRecv(uint64_t bytes); |
|
|
|
static void RecordBytesSent(uint64_t bytes); |
|
|
|
static void RecordBytesSent(uint64_t bytes); |
|
|
|