aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorJon Lund Steffensen <jonlst@gmail.com>2013-03-26 02:33:25 +0100
committerLuke Dashjr <luke-jr+git@utopios.org>2016-10-24 10:23:58 +0000
commit7c9a98aac843c9efabd8653caebc35e968b2f335 (patch)
tree3792d80c0d93ba74067a3d59cad4e39527a3a914 /src/net.h
parent5d0219d983b6cb8de5b4faf3f78a6781c99e442b (diff)
downloadbitcoin-7c9a98aac843c9efabd8653caebc35e968b2f335.tar.xz
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.
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/net.h b/src/net.h
index d0b2773623..6912c0f97b 100644
--- a/src/net.h
+++ b/src/net.h
@@ -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;