bitcoin/bitcoin — pull request #2412 by jonls (2013-03-26 02:33:14+00:00)
Title: Network activity toggle

Allow the network activity of the client to be toggled temporarily.

When network activity is disabled the client will close all connections, stop accepting inbound connections, and stop opening new outbound connections, until the network activity is reenabled. The first commit adds this feature to the core, accessed through ToggleNetworkActive().

Second commit adds an RPC command "togglenetwork" to toggle on/off.

Third commit adds further connections to the gui. When the network activity is disabled the status bar and the debug window will show this. In addition the commit adds a button to the debug window to toggle network activity.

![bitcoin-network-activity](https://f.cloud.github.com/assets/420734/301091/75019bd4-95bd-11e2-91f2-c37c05891b31.png)

Open issues:
* Should the core close the listening socket or is it enough to just disregard incoming connections by closing them immediately?
* The gui is updated about the network activity state through NotifyNumConnectionsChanged. Perhaps there should be a seperate notification signal for the network activity state.