aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorCory Fields <cory-nospam-@coryfields.com>2016-04-16 18:12:58 -0400
committerCory Fields <cory-nospam-@coryfields.com>2016-09-08 12:12:58 -0400
commit8ae2dac1c65349e4620422a43b7fa9d49af52c11 (patch)
tree01bce145e22f6b1319fe9b68eb71f1af05962f00 /src/net.h
parent502dd3a8a0bc0d12744e75f84a22cc12074c5683 (diff)
net: move added node functions to CConnman
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/net.h b/src/net.h
index 81de7f5a98..f343646cba 100644
--- a/src/net.h
+++ b/src/net.h
@@ -87,6 +87,14 @@ unsigned int SendBufferSize();
typedef int NodeId;
+struct AddedNodeInfo
+{
+ std::string strAddedNode;
+ CService resolvedAddress;
+ bool fConnected;
+ bool fInbound;
+};
+
CNode* FindNode(const CNetAddr& ip);
CNode* FindNode(const CSubNet& subNet);
CNode* FindNode(const std::string& addrName);
@@ -137,6 +145,11 @@ public:
void SetBanned(const banmap_t &banmap);
void AddOneShot(const std::string& strDest);
+
+ bool AddNode(const std::string& node);
+ bool RemoveAddedNode(const std::string& node);
+ std::vector<AddedNodeInfo> GetAddedNodeInfo();
+
private:
struct ListenSocket {
SOCKET socket;
@@ -173,6 +186,8 @@ private:
CAddrMan addrman;
std::deque<std::string> vOneShots;
CCriticalSection cs_vOneShots;
+ std::vector<std::string> vAddedNodes;
+ CCriticalSection cs_vAddedNodes;
};
extern std::unique_ptr<CConnman> g_connman;
void MapPort(bool fUseUPnP);
@@ -252,9 +267,6 @@ extern std::vector<CNode*> vNodes;
extern CCriticalSection cs_vNodes;
extern limitedmap<uint256, int64_t> mapAlreadyAskedFor;
-extern std::vector<std::string> vAddedNodes;
-extern CCriticalSection cs_vAddedNodes;
-
extern NodeId nLastNodeId;
extern CCriticalSection cs_nLastNodeId;
@@ -807,14 +819,4 @@ void RelayTransaction(const CTransaction& tx);
/** Return a timestamp in the future (in microseconds) for exponentially distributed events. */
int64_t PoissonNextSend(int64_t nNow, int average_interval_seconds);
-struct AddedNodeInfo
-{
- std::string strAddedNode;
- CService resolvedAddress;
- bool fConnected;
- bool fInbound;
-};
-
-std::vector<AddedNodeInfo> GetAddedNodeInfo();
-
#endif // BITCOIN_NET_H