Add RPCisTestNet chain parameter

This commit is contained in:
jtimon 2014-03-22 20:20:43 +01:00
parent cfeb8235fd
commit 6fc0fa63d9
4 changed files with 5 additions and 2 deletions

View File

@ -227,6 +227,7 @@ public:
virtual bool AllowMinDifficultyBlocks() const { return true; } virtual bool AllowMinDifficultyBlocks() const { return true; }
virtual bool RequireStandard() const { return false; } virtual bool RequireStandard() const { return false; }
virtual bool RPCisTestNet() const { return true; }
virtual Network NetworkID() const { return CChainParams::TESTNET; } virtual Network NetworkID() const { return CChainParams::TESTNET; }
}; };
static CTestNetParams testNetParams; static CTestNetParams testNetParams;

View File

@ -74,6 +74,8 @@ public:
virtual bool AllowMinDifficultyBlocks() const { return false; } virtual bool AllowMinDifficultyBlocks() const { return false; }
/* Make standard checks */ /* Make standard checks */
virtual bool RequireStandard() const { return true; } virtual bool RequireStandard() const { return true; }
/* Make standard checks */
virtual bool RPCisTestNet() const { return false; }
const string& DataDir() const { return strDataDir; } const string& DataDir() const { return strDataDir; }
/* Make miner stop after a block is found. In RPC, don't return /* Make miner stop after a block is found. In RPC, don't return
* until nGenProcLimit blocks are generated */ * until nGenProcLimit blocks are generated */

View File

@ -265,7 +265,7 @@ Value getmininginfo(const Array& params, bool fHelp)
obj.push_back(Pair("genproclimit", (int)GetArg("-genproclimit", -1))); obj.push_back(Pair("genproclimit", (int)GetArg("-genproclimit", -1)));
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", TestNet())); obj.push_back(Pair("testnet", Params().RPCisTestNet()));
#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)));

View File

@ -73,7 +73,7 @@ Value getinfo(const Array& params, bool fHelp)
obj.push_back(Pair("connections", (int)vNodes.size())); obj.push_back(Pair("connections", (int)vNodes.size()));
obj.push_back(Pair("proxy", (proxy.first.IsValid() ? proxy.first.ToStringIPPort() : string()))); obj.push_back(Pair("proxy", (proxy.first.IsValid() ? proxy.first.ToStringIPPort() : string())));
obj.push_back(Pair("difficulty", (double)GetDifficulty())); obj.push_back(Pair("difficulty", (double)GetDifficulty()));
obj.push_back(Pair("testnet", TestNet())); obj.push_back(Pair("testnet", Params().RPCisTestNet()));
#ifdef ENABLE_WALLET #ifdef ENABLE_WALLET
if (pwalletMain) { if (pwalletMain) {
obj.push_back(Pair("keypoololdest", pwalletMain->GetOldestKeyPoolTime())); obj.push_back(Pair("keypoololdest", pwalletMain->GetOldestKeyPoolTime()));