Skip to content

Commit f6984e8

Browse files
committed
Add "chain" to getmininginfo, improve help in getblockchaininfo
1 parent b82b7ec commit f6984e8

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/rpcblockchain.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ Value getblockchaininfo(const Array& params, bool fHelp)
438438
"Returns an object containing various state info regarding block chain processing.\n"
439439
"\nResult:\n"
440440
"{\n"
441-
" \"chain\": \"xxxx\", (string) current chain (main, testnet3, regtest)\n"
441+
" \"chain\": \"xxxx\", (string) current network name as defined in BIP70 (main, test, regtest)\n"
442442
" \"blocks\": xxxxxx, (numeric) the current number of blocks processed in the server\n"
443443
" \"bestblockhash\": \"...\", (string) the hash of the currently best block\n"
444444
" \"difficulty\": xxxxxx, (numeric) the current difficulty\n"

src/rpcmining.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ Value getmininginfo(const Array& params, bool fHelp)
253253
" \"hashespersec\": n (numeric) The hashes per second of the generation, or 0 if no generation.\n"
254254
" \"pooledtx\": n (numeric) The size of the mem pool\n"
255255
" \"testnet\": true|false (boolean) If using testnet or not\n"
256+
" \"chain\": \"xxxx\", (string) current network name as defined in BIP70 (main, test, regtest)\n"
256257
"}\n"
257258
"\nExamples:\n"
258259
+ HelpExampleCli("getmininginfo", "")
@@ -269,6 +270,7 @@ Value getmininginfo(const Array& params, bool fHelp)
269270
obj.push_back(Pair("networkhashps", getnetworkhashps(params, false)));
270271
obj.push_back(Pair("pooledtx", (uint64_t)mempool.size()));
271272
obj.push_back(Pair("testnet", Params().NetworkID() == CChainParams::TESTNET));
273+
obj.push_back(Pair("chain", Params().NetworkIDString()));
272274
#ifdef ENABLE_WALLET
273275
obj.push_back(Pair("generate", getgenerate(params, false)));
274276
obj.push_back(Pair("hashespersec", gethashespersec(params, false)));

0 commit comments

Comments
 (0)