From 8ae2dac1c65349e4620422a43b7fa9d49af52c11 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Sat, 16 Apr 2016 18:12:58 -0400 Subject: net: move added node functions to CConnman --- src/net.h | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'src/net.h') 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 GetAddedNodeInfo(); + private: struct ListenSocket { SOCKET socket; @@ -173,6 +186,8 @@ private: CAddrMan addrman; std::deque vOneShots; CCriticalSection cs_vOneShots; + std::vector vAddedNodes; + CCriticalSection cs_vAddedNodes; }; extern std::unique_ptr g_connman; void MapPort(bool fUseUPnP); @@ -252,9 +267,6 @@ extern std::vector vNodes; extern CCriticalSection cs_vNodes; extern limitedmap mapAlreadyAskedFor; -extern std::vector 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 GetAddedNodeInfo(); - #endif // BITCOIN_NET_H -- cgit v1.2.3