Add "chain" to getmininginfo, improve help in getblockchaininfo

This commit is contained in:
jtimon 2014-06-12 14:52:12 +02:00
parent b82b7ec3dc
commit f6984e8141
2 changed files with 3 additions and 1 deletions

View file

@ -438,7 +438,7 @@ Value getblockchaininfo(const Array& params, bool fHelp)
"Returns an object containing various state info regarding block chain processing.\n" "Returns an object containing various state info regarding block chain processing.\n"
"\nResult:\n" "\nResult:\n"
"{\n" "{\n"
" \"chain\": \"xxxx\", (string) current chain (main, testnet3, regtest)\n" " \"chain\": \"xxxx\", (string) current network name as defined in BIP70 (main, test, regtest)\n"
" \"blocks\": xxxxxx, (numeric) the current number of blocks processed in the server\n" " \"blocks\": xxxxxx, (numeric) the current number of blocks processed in the server\n"
" \"bestblockhash\": \"...\", (string) the hash of the currently best block\n" " \"bestblockhash\": \"...\", (string) the hash of the currently best block\n"
" \"difficulty\": xxxxxx, (numeric) the current difficulty\n" " \"difficulty\": xxxxxx, (numeric) the current difficulty\n"

View file

@ -253,6 +253,7 @@ Value getmininginfo(const Array& params, bool fHelp)
" \"hashespersec\": n (numeric) The hashes per second of the generation, or 0 if no generation.\n" " \"hashespersec\": n (numeric) The hashes per second of the generation, or 0 if no generation.\n"
" \"pooledtx\": n (numeric) The size of the mem pool\n" " \"pooledtx\": n (numeric) The size of the mem pool\n"
" \"testnet\": true|false (boolean) If using testnet or not\n" " \"testnet\": true|false (boolean) If using testnet or not\n"
" \"chain\": \"xxxx\", (string) current network name as defined in BIP70 (main, test, regtest)\n"
"}\n" "}\n"
"\nExamples:\n" "\nExamples:\n"
+ HelpExampleCli("getmininginfo", "") + HelpExampleCli("getmininginfo", "")
@ -269,6 +270,7 @@ Value getmininginfo(const Array& params, bool fHelp)
obj.push_back(Pair("networkhashps", getnetworkhashps(params, false))); obj.push_back(Pair("networkhashps", getnetworkhashps(params, false)));
obj.push_back(Pair("pooledtx", (uint64_t)mempool.size())); obj.push_back(Pair("pooledtx", (uint64_t)mempool.size()));
obj.push_back(Pair("testnet", Params().NetworkID() == CChainParams::TESTNET)); obj.push_back(Pair("testnet", Params().NetworkID() == CChainParams::TESTNET));
obj.push_back(Pair("chain", Params().NetworkIDString()));
#ifdef ENABLE_WALLET #ifdef ENABLE_WALLET
obj.push_back(Pair("generate", getgenerate(params, false))); obj.push_back(Pair("generate", getgenerate(params, false)));
obj.push_back(Pair("hashespersec", gethashespersec(params, false))); obj.push_back(Pair("hashespersec", gethashespersec(params, false)));