Browse Source

Add RPCisTestNet chain parameter

0.10
jtimon 11 years ago
parent
commit
6fc0fa63d9
  1. 1
      src/chainparams.cpp
  2. 2
      src/chainparams.h
  3. 2
      src/rpcmining.cpp
  4. 2
      src/rpcmisc.cpp

1
src/chainparams.cpp

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

2
src/chainparams.h

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

2
src/rpcmining.cpp

@ -265,7 +265,7 @@ Value getmininginfo(const Array& params, bool fHelp) @@ -265,7 +265,7 @@ 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", TestNet()));
obj.push_back(Pair("testnet", Params().RPCisTestNet()));
#ifdef ENABLE_WALLET
obj.push_back(Pair("generate", getgenerate(params, false)));
obj.push_back(Pair("hashespersec", gethashespersec(params, false)));

2
src/rpcmisc.cpp

@ -73,7 +73,7 @@ Value getinfo(const Array& params, bool fHelp) @@ -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", TestNet()));
obj.push_back(Pair("testnet", Params().RPCisTestNet()));
#ifdef ENABLE_WALLET
if (pwalletMain) {
obj.push_back(Pair("keypoololdest", pwalletMain->GetOldestKeyPoolTime()));

Loading…
Cancel
Save