Skip to content

Commit

Permalink
Merge pull request #4333
Browse files Browse the repository at this point in the history
f6984e8 Add "chain" to getmininginfo, improve help in getblockchaininfo (jtimon)
b82b7ec Get rid of Params().RPCisTestNet() (jtimon)
  • Loading branch information
laanwj committed Jun 17, 2014
2 parents e164828 + f6984e8 commit 2151419
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 9 deletions.
3 changes: 0 additions & 3 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ class CMainParams : public CChainParams {
fDefaultCheckMemPool = false;
fAllowMinDifficultyBlocks = false;
fRequireStandard = true;
fRPCisTestNet = false;
fMineBlocksOnDemand = false;
}
};
Expand Down Expand Up @@ -230,7 +229,6 @@ class CTestNetParams : public CMainParams {
fDefaultCheckMemPool = false;
fAllowMinDifficultyBlocks = true;
fRequireStandard = false;
fRPCisTestNet = true;
fMineBlocksOnDemand = false;
}
};
Expand Down Expand Up @@ -269,7 +267,6 @@ class CRegTestParams : public CTestNetParams {
fDefaultCheckMemPool = true;
fAllowMinDifficultyBlocks = true;
fRequireStandard = false;
fRPCisTestNet = true;
fMineBlocksOnDemand = true;
}
};
Expand Down
3 changes: 0 additions & 3 deletions src/chainparams.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ class CChainParams
bool AllowMinDifficultyBlocks() const { return fAllowMinDifficultyBlocks; }
/* Make standard checks */
bool RequireStandard() const { return fRequireStandard; }
/* Make standard checks */
bool RPCisTestNet() const { return fRPCisTestNet; }
const std::string& DataDir() const { return strDataDir; }
/* Make miner stop after a block is found. In RPC, don't return
* until nGenProcLimit blocks are generated */
Expand Down Expand Up @@ -110,7 +108,6 @@ class CChainParams
bool fDefaultCheckMemPool;
bool fAllowMinDifficultyBlocks;
bool fRequireStandard;
bool fRPCisTestNet;
bool fMineBlocksOnDemand;
};

Expand Down
2 changes: 1 addition & 1 deletion src/rpcblockchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ Value getblockchaininfo(const Array& params, bool fHelp)
"Returns an object containing various state info regarding block chain processing.\n"
"\nResult:\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"
" \"bestblockhash\": \"...\", (string) the hash of the currently best block\n"
" \"difficulty\": xxxxxx, (numeric) the current difficulty\n"
Expand Down
4 changes: 3 additions & 1 deletion src/rpcmining.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
" \"pooledtx\": n (numeric) The size of the mem pool\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"
"\nExamples:\n"
+ HelpExampleCli("getmininginfo", "")
Expand All @@ -268,7 +269,8 @@ Value getmininginfo(const Array& params, bool fHelp)
obj.push_back(Pair("genproclimit", (int)GetArg("-genproclimit", -1)));
obj.push_back(Pair("networkhashps", getnetworkhashps(params, false)));
obj.push_back(Pair("pooledtx", (uint64_t)mempool.size()));
obj.push_back(Pair("testnet", Params().RPCisTestNet()));
obj.push_back(Pair("testnet", Params().NetworkID() == CChainParams::TESTNET));
obj.push_back(Pair("chain", Params().NetworkIDString()));
#ifdef ENABLE_WALLET
obj.push_back(Pair("generate", getgenerate(params, false)));
obj.push_back(Pair("hashespersec", gethashespersec(params, false)));
Expand Down
2 changes: 1 addition & 1 deletion src/rpcmisc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Value getinfo(const Array& params, bool fHelp)
obj.push_back(Pair("connections", (int)vNodes.size()));
obj.push_back(Pair("proxy", (proxy.first.IsValid() ? proxy.first.ToStringIPPort() : string())));
obj.push_back(Pair("difficulty", (double)GetDifficulty()));
obj.push_back(Pair("testnet", Params().RPCisTestNet()));
obj.push_back(Pair("testnet", Params().NetworkID() == CChainParams::TESTNET));
#ifdef ENABLE_WALLET
if (pwalletMain) {
obj.push_back(Pair("keypoololdest", pwalletMain->GetOldestKeyPoolTime()));
Expand Down

0 comments on commit 2151419

Please sign in to comment.