diff options
| author | Jon Lund Steffensen <[email protected]> | 2013-03-26 02:38:24 +0100 |
|---|---|---|
| committer | Luke Dashjr <[email protected]> | 2016-10-24 10:23:58 +0000 |
| commit | e38993bb36801d492cad87479b8473794f19c9da (patch) | |
| tree | 805ddc37482556fac351fa2a9e20d0e93219ef2b /src/rpc/misc.cpp | |
| parent | Allow network activity to be temporarily suspended. (diff) | |
| download | discoin-e38993bb36801d492cad87479b8473794f19c9da.tar.xz discoin-e38993bb36801d492cad87479b8473794f19c9da.zip | |
RPC: Add "togglenetwork" method to toggle network activity temporarily
RPC command "togglenetwork" toggles network and returns new state after command.
RPC command "getinfo" returns "networkactive" field in output.
Diffstat (limited to 'src/rpc/misc.cpp')
| -rw-r--r-- | src/rpc/misc.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp index 5afcf6353..4bfcc9387 100644 --- a/src/rpc/misc.cpp +++ b/src/rpc/misc.cpp @@ -89,8 +89,10 @@ UniValue getinfo(const UniValue& params, bool fHelp) #endif obj.push_back(Pair("blocks", (int)chainActive.Height())); obj.push_back(Pair("timeoffset", GetTimeOffset())); - if(g_connman) + if (g_connman) { + obj.push_back(Pair("networkactive", g_connman->GetNetworkActive())); obj.push_back(Pair("connections", (int)g_connman->GetNodeCount(CConnman::CONNECTIONS_ALL))); + } obj.push_back(Pair("proxy", (proxy.IsValid() ? proxy.proxy.ToStringIPPort() : string()))); obj.push_back(Pair("difficulty", (double)GetDifficulty())); obj.push_back(Pair("testnet", Params().TestnetToBeDeprecatedFieldRPC())); |