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 SetNetworkActive().
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.
Open issues:
- Should the core close the listening socket or is it enough to just disregard incoming connections by closing them immediately?
- Should SetNetworkActive() return an error code or can it throw exceptions?