Skip to content

Commit b26a7b5

Browse files
committed
RPC: Chainparams: Remove Chainparams::fTestnetToBeDeprecatedFieldRPC
1 parent e2b8c39 commit b26a7b5

File tree

5 files changed

+3
-9
lines changed

5 files changed

+3
-9
lines changed

doc/release-notes.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ contain invalid parameters.
6565

6666
The first boolean argument to `getaddednodeinfo` has been removed. This is an incompatible change.
6767

68+
Call "getmininginfo" loses the "testnet" field in favor of the more generic "chain" (which has been present for years).
69+
6870
### Configuration and command-line options
6971

7072
### Block and transaction handling

src/chainparams.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ class CMainParams : public CChainParams {
132132
fDefaultConsistencyChecks = false;
133133
fRequireStandard = true;
134134
fMineBlocksOnDemand = false;
135-
fTestnetToBeDeprecatedFieldRPC = false;
136135

137136
checkpointData = (CCheckpointData) {
138137
boost::assign::map_list_of
@@ -223,7 +222,6 @@ class CTestNetParams : public CChainParams {
223222
fDefaultConsistencyChecks = false;
224223
fRequireStandard = false;
225224
fMineBlocksOnDemand = false;
226-
fTestnetToBeDeprecatedFieldRPC = true;
227225

228226
checkpointData = (CCheckpointData) {
229227
boost::assign::map_list_of
@@ -285,7 +283,6 @@ class CRegTestParams : public CChainParams {
285283
fDefaultConsistencyChecks = true;
286284
fRequireStandard = false;
287285
fMineBlocksOnDemand = true;
288-
fTestnetToBeDeprecatedFieldRPC = false;
289286

290287
checkpointData = (CCheckpointData){
291288
boost::assign::map_list_of

src/chainparams.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,6 @@ class CChainParams
6767
uint64_t PruneAfterHeight() const { return nPruneAfterHeight; }
6868
/** Make miner stop after a block is found. In RPC, don't return until nGenProcLimit blocks are generated */
6969
bool MineBlocksOnDemand() const { return fMineBlocksOnDemand; }
70-
/** In the future use NetworkIDString() for RPC fields */
71-
bool TestnetToBeDeprecatedFieldRPC() const { return fTestnetToBeDeprecatedFieldRPC; }
7270
/** Return the BIP70 network string (main, test or regtest) */
7371
std::string NetworkIDString() const { return strNetworkID; }
7472
const std::vector<CDNSSeedData>& DNSSeeds() const { return vSeeds; }
@@ -91,7 +89,6 @@ class CChainParams
9189
bool fDefaultConsistencyChecks;
9290
bool fRequireStandard;
9391
bool fMineBlocksOnDemand;
94-
bool fTestnetToBeDeprecatedFieldRPC;
9592
CCheckpointData checkpointData;
9693
};
9794

src/rpc/mining.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,6 @@ UniValue getmininginfo(const UniValue& params, bool fHelp)
230230
" \"errors\": \"...\" (string) Current errors\n"
231231
" \"networkhashps\": nnn, (numeric) The network hashes per second\n"
232232
" \"pooledtx\": n (numeric) The size of the mem pool\n"
233-
" \"testnet\": true|false (boolean) If using testnet or not\n"
234233
" \"chain\": \"xxxx\", (string) current network name as defined in BIP70 (main, test, regtest)\n"
235234
"}\n"
236235
"\nExamples:\n"
@@ -250,7 +249,6 @@ UniValue getmininginfo(const UniValue& params, bool fHelp)
250249
obj.push_back(Pair("errors", GetWarnings("statusbar")));
251250
obj.push_back(Pair("networkhashps", getnetworkhashps(params, false)));
252251
obj.push_back(Pair("pooledtx", (uint64_t)mempool.size()));
253-
obj.push_back(Pair("testnet", Params().TestnetToBeDeprecatedFieldRPC()));
254252
obj.push_back(Pair("chain", Params().NetworkIDString()));
255253
return obj;
256254
}

src/rpc/misc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ UniValue getinfo(const UniValue& params, bool fHelp)
9393
obj.push_back(Pair("connections", (int)g_connman->GetNodeCount(CConnman::CONNECTIONS_ALL)));
9494
obj.push_back(Pair("proxy", (proxy.IsValid() ? proxy.proxy.ToStringIPPort() : string())));
9595
obj.push_back(Pair("difficulty", (double)GetDifficulty()));
96-
obj.push_back(Pair("testnet", Params().TestnetToBeDeprecatedFieldRPC()));
96+
obj.push_back(Pair("testnet", Params().NetworkIDString() == CBaseChainParams::TESTNET));
9797
#ifdef ENABLE_WALLET
9898
if (pwalletMain) {
9999
obj.push_back(Pair("keypoololdest", pwalletMain->GetOldestKeyPoolTime()));

0 commit comments

Comments
 (0)