From a22b7bac99e2948a5ce21561d86b25d0400576de Mon Sep 17 00:00:00 2001 From: svost Date: Mon, 3 Oct 2016 17:43:30 +0300 Subject: [PATCH] Remove namespace from net.h --- src/net.h | 43 +++++++++++++++++++++---------------------- 1 files changed, 21 insertions(+), 22 deletions(-) diff --git a/src/net.h b/src/net.h index 511788e..0d94116 100644 --- a/src/net.h +++ b/src/net.h @@ -16,7 +16,6 @@ #include "addrman.h" #include "hash.h" -using namespace std; class CRequestTracker; class CNode; @@ -30,8 +29,8 @@ const uint16_t nPortZero = 0; inline uint64_t ReceiveBufferSize() { return 1000*GetArg("-maxreceivebuffer", 5*1000); } inline uint64_t SendBufferSize() { return 1000*GetArg("-maxsendbuffer", 1*1000); } -void AddOneShot(string strDest); -bool RecvLine(SOCKET hSocket, string& strLine); +void AddOneShot(std::string strDest); +bool RecvLine(SOCKET hSocket, std::string& strLine); bool GetMyExternalIP(CNetAddr& ipRet); void AddressCurrentlyConnected(const CService& addr); CNode* FindNode(const CNetAddr& ip); @@ -39,7 +38,7 @@ CNode* FindNode(const CService& ip); CNode* ConnectNode(CAddress addrConnect, const char *strDest = NULL, int64_t nTimeout=0); bool OpenNetworkConnection(const CAddress& addrConnect, CSemaphoreGrant *grantOutbound = NULL, const char *strDest = NULL, bool fOneShot = false); uint16_t GetListenPort(); -bool BindListenPort(const CService &bindAddr, string& strError=REF(string())); +bool BindListenPort(const CService &bindAddr, std::string& strError=REF(std::string())); void StartNode(void* parg); bool StopNode(); @@ -123,17 +122,17 @@ extern bool fDiscover; extern uint64_t nLocalServices; extern uint64_t nLocalHostNonce; extern CAddress addrSeenByPeer; -extern array vnThreadsRunning; +extern std::array vnThreadsRunning; extern CAddrMan addrman; -extern vector vNodes; +extern std::vector vNodes; extern CCriticalSection cs_vNodes; -extern vector vAddedNodes; +extern std::vector vAddedNodes; extern CCriticalSection cs_vAddedNodes; -extern map mapRelay; -extern deque > vRelayExpiration; +extern std::map mapRelay; +extern std::deque > vRelayExpiration; extern CCriticalSection cs_mapRelay; -extern map mapAlreadyAskedFor; +extern std::map mapAlreadyAskedFor; class CNodeStats @@ -143,9 +142,9 @@ public: int64_t nLastSend; int64_t nLastRecv; int64_t nTimeConnected; - string addrName; + std::string addrName; int32_t nVersion; - string strSubVer; + std::string strSubVer; bool fInbound; int64_t nReleaseTime; int32_t nStartingHeight; @@ -176,10 +175,10 @@ public: int32_t nHeaderStart; uint32_t nMessageStart; CAddress addr; - string addrName; + std::string addrName; CService addrLocal; int32_t nVersion; - string strSubVer; + std::string strSubVer; bool fOneShot; bool fClient; bool fInbound; @@ -192,13 +191,13 @@ protected: // Denial-of-service detection/prevention // Key is IP address, value is banned-until-time - static map setBanned; + static std::map setBanned; static CCriticalSection cs_setBanned; int nMisbehavior; public: int64_t nReleaseTime; - map mapRequests; + std::map mapRequests; CCriticalSection cs_mapRequests; uint256 hashContinue; CBlockIndex* pindexLastGetBlocksBegin; @@ -207,10 +206,10 @@ public: bool fStartSync; // flood relay - vector vAddrToSend; - set setAddrKnown; + std::vector vAddrToSend; + std::set setAddrKnown; bool fGetAddr; - set setKnown; + std::set setKnown; uint256 hashCheckpointKnown; // ppcoin: known sent sync-checkpoint int64_t nNextAddrSend; int64_t nNextLocalAddrSend; @@ -218,11 +217,11 @@ public: // inventory based relay mruset setInventoryKnown; - vector vInventoryToSend; + std::vector vInventoryToSend; CCriticalSection cs_inventory; - multimap mapAskFor; + std::multimap mapAskFor; - CNode(SOCKET hSocketIn, CAddress addrIn, string addrNameIn = "", bool fInboundIn=false); + CNode(SOCKET hSocketIn, CAddress addrIn, std::string addrNameIn = "", bool fInboundIn=false); ~CNode(); private: -- 1.7.1