Browse Source

Add fTestnetToBeDeprecatedFieldRPC to CChainParams

0.10
jtimon 10 years ago
parent
commit
cc97210799
  1. 3
      src/chainparams.cpp
  2. 3
      src/chainparams.h
  3. 2
      src/rpcmining.cpp
  4. 2
      src/rpcmisc.cpp

3
src/chainparams.cpp

@ -167,6 +167,7 @@ public:
fRequireStandard = true; fRequireStandard = true;
fMineBlocksOnDemand = false; fMineBlocksOnDemand = false;
fSkipProofOfWorkCheck = false; fSkipProofOfWorkCheck = false;
fTestnetToBeDeprecatedFieldRPC = false;
} }
const Checkpoints::CCheckpointData& Checkpoints() const const Checkpoints::CCheckpointData& Checkpoints() const
@ -228,6 +229,7 @@ public:
fAllowMinDifficultyBlocks = true; fAllowMinDifficultyBlocks = true;
fRequireStandard = false; fRequireStandard = false;
fMineBlocksOnDemand = false; fMineBlocksOnDemand = false;
fTestnetToBeDeprecatedFieldRPC = true;
} }
const Checkpoints::CCheckpointData& Checkpoints() const const Checkpoints::CCheckpointData& Checkpoints() const
{ {
@ -271,6 +273,7 @@ public:
fAllowMinDifficultyBlocks = true; fAllowMinDifficultyBlocks = true;
fRequireStandard = false; fRequireStandard = false;
fMineBlocksOnDemand = true; fMineBlocksOnDemand = true;
fTestnetToBeDeprecatedFieldRPC = false;
} }
const Checkpoints::CCheckpointData& Checkpoints() const const Checkpoints::CCheckpointData& Checkpoints() const
{ {

3
src/chainparams.h

@ -72,6 +72,8 @@ public:
/* 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 */
bool MineBlocksOnDemand() const { return fMineBlocksOnDemand; } bool MineBlocksOnDemand() const { return fMineBlocksOnDemand; }
/* In the future use NetworkIDString() for RPC fields */
bool TestnetToBeDeprecatedFieldRPC() const { return fTestnetToBeDeprecatedFieldRPC; }
CBaseChainParams::Network NetworkID() const { return networkID; } CBaseChainParams::Network NetworkID() const { return networkID; }
/* Return the BIP70 network string (main, test or regtest) */ /* Return the BIP70 network string (main, test or regtest) */
std::string NetworkIDString() const { return strNetworkID; } std::string NetworkIDString() const { return strNetworkID; }
@ -108,6 +110,7 @@ protected:
bool fRequireStandard; bool fRequireStandard;
bool fMineBlocksOnDemand; bool fMineBlocksOnDemand;
bool fSkipProofOfWorkCheck; bool fSkipProofOfWorkCheck;
bool fTestnetToBeDeprecatedFieldRPC;
}; };
/** Modifiable parameters interface is used by test cases to adapt the parameters in order /** Modifiable parameters interface is used by test cases to adapt the parameters in order

2
src/rpcmining.cpp

@ -239,7 +239,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", Params().NetworkID() == CBaseChainParams::TESTNET)); obj.push_back(Pair("testnet", Params().TestnetToBeDeprecatedFieldRPC()));
obj.push_back(Pair("chain", Params().NetworkIDString())); 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)));

2
src/rpcmisc.cpp

@ -87,7 +87,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.IsValid() ? proxy.ToStringIPPort() : string()))); obj.push_back(Pair("proxy", (proxy.IsValid() ? proxy.ToStringIPPort() : string())));
obj.push_back(Pair("difficulty", (double)GetDifficulty())); obj.push_back(Pair("difficulty", (double)GetDifficulty()));
obj.push_back(Pair("testnet", Params().NetworkID() == CBaseChainParams::TESTNET)); obj.push_back(Pair("testnet", Params().TestnetToBeDeprecatedFieldRPC()));
#ifdef ENABLE_WALLET #ifdef ENABLE_WALLET
if (pwalletMain) { if (pwalletMain) {
obj.push_back(Pair("keypoololdest", pwalletMain->GetOldestKeyPoolTime())); obj.push_back(Pair("keypoololdest", pwalletMain->GetOldestKeyPoolTime()));

Loading…
Cancel
Save