aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjtimon <jtimon@blockstream.io>2014-08-31 22:32:52 +0200
committerjtimon <jtimon@blockstream.io>2014-10-10 11:01:00 +0200
commitcc972107997122cb31f015b4e70f81781dbce784 (patch)
treefa8a7ab017f33df0ca599c0ca6dd0281e62574bb
parente11712df7ea5e946c5ec008d1c761187b495f872 (diff)
Add fTestnetToBeDeprecatedFieldRPC to CChainParams
-rw-r--r--src/chainparams.cpp3
-rw-r--r--src/chainparams.h3
-rw-r--r--src/rpcmining.cpp2
-rw-r--r--src/rpcmisc.cpp2
4 files changed, 8 insertions, 2 deletions
diff --git a/src/chainparams.cpp b/src/chainparams.cpp
index a81b618208..f2a14b8293 100644
--- a/src/chainparams.cpp
+++ b/src/chainparams.cpp
@@ -167,6 +167,7 @@ public:
fRequireStandard = true;
fMineBlocksOnDemand = false;
fSkipProofOfWorkCheck = false;
+ fTestnetToBeDeprecatedFieldRPC = false;
}
const Checkpoints::CCheckpointData& Checkpoints() const
@@ -228,6 +229,7 @@ public:
fAllowMinDifficultyBlocks = true;
fRequireStandard = false;
fMineBlocksOnDemand = false;
+ fTestnetToBeDeprecatedFieldRPC = true;
}
const Checkpoints::CCheckpointData& Checkpoints() const
{
@@ -271,6 +273,7 @@ public:
fAllowMinDifficultyBlocks = true;
fRequireStandard = false;
fMineBlocksOnDemand = true;
+ fTestnetToBeDeprecatedFieldRPC = false;
}
const Checkpoints::CCheckpointData& Checkpoints() const
{
diff --git a/src/chainparams.h b/src/chainparams.h
index d3b1781b4d..21d3b4d526 100644
--- a/src/chainparams.h
+++ b/src/chainparams.h
@@ -72,6 +72,8 @@ public:
/* Make miner stop after a block is found. In RPC, don't return
* until nGenProcLimit blocks are generated */
bool MineBlocksOnDemand() const { return fMineBlocksOnDemand; }
+ /* In the future use NetworkIDString() for RPC fields */
+ bool TestnetToBeDeprecatedFieldRPC() const { return fTestnetToBeDeprecatedFieldRPC; }
CBaseChainParams::Network NetworkID() const { return networkID; }
/* Return the BIP70 network string (main, test or regtest) */
std::string NetworkIDString() const { return strNetworkID; }
@@ -108,6 +110,7 @@ protected:
bool fRequireStandard;
bool fMineBlocksOnDemand;
bool fSkipProofOfWorkCheck;
+ bool fTestnetToBeDeprecatedFieldRPC;
};
/** Modifiable parameters interface is used by test cases to adapt the parameters in order
diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp
index e794bf69e0..c767835a27 100644
--- a/src/rpcmining.cpp
+++ b/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("networkhashps", getnetworkhashps(params, false)));
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()));
#ifdef ENABLE_WALLET
obj.push_back(Pair("generate", getgenerate(params, false)));
diff --git a/src/rpcmisc.cpp b/src/rpcmisc.cpp
index dd45eefd58..8be14b567c 100644
--- a/src/rpcmisc.cpp
+++ b/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("proxy", (proxy.IsValid() ? proxy.ToStringIPPort() : string())));
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
if (pwalletMain) {
obj.push_back(Pair("keypoololdest", pwalletMain->GetOldestKeyPoolTime()));