aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorCory Fields <cory-nospam-@coryfields.com>2016-04-16 18:30:03 -0400
committerCory Fields <cory-nospam-@coryfields.com>2016-09-08 12:12:58 -0400
commitc0569c7fa1e25599b3f1d6a16b15ec23052021da (patch)
tree608dc14407c8f28de2d6480910a13883dc47cefe /src/net.h
parent8ae2dac1c65349e4620422a43b7fa9d49af52c11 (diff)
downloadbitcoin-c0569c7fa1e25599b3f1d6a16b15ec23052021da.tar.xz
net: Add most functions needed for vNodes to CConnman
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/net.h b/src/net.h
index f343646cba..9e2408cd70 100644
--- a/src/net.h
+++ b/src/net.h
@@ -101,9 +101,18 @@ CNode* FindNode(const std::string& addrName);
CNode* FindNode(const CService& ip);
CNode* FindNode(const NodeId id); //TODO: Remove this
+class CNodeStats;
class CConnman
{
public:
+
+ enum NumConnections {
+ CONNECTIONS_NONE = 0,
+ CONNECTIONS_IN = (1U << 0),
+ CONNECTIONS_OUT = (1U << 1),
+ CONNECTIONS_ALL = (CONNECTIONS_IN | CONNECTIONS_OUT),
+ };
+
CConnman();
~CConnman();
bool Start(boost::thread_group& threadGroup, CScheduler& scheduler, std::string& strNodeError);
@@ -150,6 +159,13 @@ public:
bool RemoveAddedNode(const std::string& node);
std::vector<AddedNodeInfo> GetAddedNodeInfo();
+ size_t GetNodeCount(NumConnections num);
+ void GetNodeStats(std::vector<CNodeStats>& vstats);
+ bool DisconnectAddress(const CNetAddr& addr);
+ bool DisconnectNode(const std::string& node);
+ bool DisconnectNode(NodeId id);
+ bool DisconnectSubnet(const CSubNet& subnet);
+
private:
struct ListenSocket {
SOCKET socket;