mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-13 15:39:05 +01:00
Allow network activity to be temporarily suspended.
Added the function SetNetworkActive() which when called with argument set to false disconnects all nodes and sets the flag fNetworkActive to false. As long as this flag is false no new connections are attempted and no incoming connections are accepted. Network activity is reenabled by calling the function with argument true.
This commit is contained in:
committed by
Luke Dashjr
parent
5d0219d983
commit
7c9a98aac8
@@ -131,6 +131,7 @@ public:
|
||||
bool Start(boost::thread_group& threadGroup, CScheduler& scheduler, std::string& strNodeError, Options options);
|
||||
void Stop();
|
||||
bool BindListenPort(const CService &bindAddr, std::string& strError, bool fWhitelisted = false);
|
||||
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 CheckIncomingNonce(uint64_t nonce);
|
||||
|
||||
@@ -370,6 +371,7 @@ private:
|
||||
unsigned int nReceiveFloodSize;
|
||||
|
||||
std::vector<ListenSocket> vhListenSocket;
|
||||
bool fNetworkActive;
|
||||
banmap_t setBanned;
|
||||
CCriticalSection cs_setBanned;
|
||||
bool setBannedIsDirty;
|
||||
|
||||
Reference in New Issue
Block a user