diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2017-06-26 14:42:46 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2017-06-26 15:04:54 +0200 |
commit | 22a0aca32974b37c50ec175181010115c1b3fc7f (patch) | |
tree | 070e7f818317bd325315149c1b6add1d79d6b123 /src/net.h | |
parent | f3f1e2e7d38005fa3edecb01469a18a6f7500ea6 (diff) | |
parent | 07b2afef10bb6366a270e325fd41a8bc526c9ef3 (diff) |
Merge #10496: Add Binds, WhiteBinds, Whitelistedrange to CConnman::Options
07b2afe add Binds, WhiteBinds to CConnman::Options (Marko Bencun)
ce79f32 add WhitelistedRange to CConnman::Options (Marko Bencun)
Tree-SHA512: c23a6f317c955338af531fa3e53e3c42e995f88c6e1939bbc2ad119fa5b786c54b3dad3d2e9b3f830b7292c0c63a02fcff66a89907d0fa8d7c83aefade01af45
Diffstat (limited to 'src/net.h')
-rw-r--r-- | src/net.h | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -144,13 +144,14 @@ public: uint64_t nMaxOutboundTimeframe = 0; uint64_t nMaxOutboundLimit = 0; std::vector<std::string> vSeedNodes; + std::vector<CSubNet> vWhitelistedRange; + std::vector<CService> vBinds, vWhiteBinds; }; CConnman(uint64_t seed0, uint64_t seed1); ~CConnman(); - bool Start(CScheduler& scheduler, std::string& strNodeError, Options options); + bool Start(CScheduler& scheduler, Options options); void Stop(); void Interrupt(); - bool BindListenPort(const CService &bindAddr, std::string& strError, bool fWhitelisted = false); bool GetNetworkActive() const { return fNetworkActive; }; void SetNetworkActive(bool active); bool OpenNetworkConnection(const CAddress& addrConnect, bool fCountFailure, CSemaphoreGrant *grantOutbound = NULL, const char *strDest = NULL, bool fOneShot = false, bool fFeeler = false, bool fAddnode = false); @@ -244,8 +245,6 @@ public: unsigned int GetSendBufferSize() const; - void AddWhitelistedRange(const CSubNet &subnet); - ServiceFlags GetLocalServices() const; //!set the max outbound target in bytes @@ -289,6 +288,9 @@ private: ListenSocket(SOCKET socket_, bool whitelisted_) : socket(socket_), whitelisted(whitelisted_) {} }; + bool BindListenPort(const CService &bindAddr, std::string& strError, bool fWhitelisted = false); + bool Bind(const CService &addr, unsigned int flags); + bool InitBinds(const std::vector<CService>& binds, const std::vector<CService>& whiteBinds); void ThreadOpenAddedConnections(); void AddOneShot(const std::string& strDest); void ProcessOneShot(); @@ -346,7 +348,6 @@ private: // 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; unsigned int nSendBufferMaxSize; unsigned int nReceiveFloodSize; |