Browse Source

RPC: Chainparams: Remove Chainparams::fTestnetToBeDeprecatedFieldRPC

0.14
Jorge Timón 8 years ago
parent
commit
b26a7b5377
No known key found for this signature in database
GPG Key ID: 8866C18EA1C944A2
  1. 2
      doc/release-notes.md
  2. 3
      src/chainparams.cpp
  3. 3
      src/chainparams.h
  4. 2
      src/rpc/mining.cpp
  5. 2
      src/rpc/misc.cpp

2
doc/release-notes.md

@ -65,6 +65,8 @@ contain invalid parameters.
The first boolean argument to `getaddednodeinfo` has been removed. This is an incompatible change. The first boolean argument to `getaddednodeinfo` has been removed. This is an incompatible change.
Call "getmininginfo" loses the "testnet" field in favor of the more generic "chain" (which has been present for years).
### Configuration and command-line options ### Configuration and command-line options
### Block and transaction handling ### Block and transaction handling

3
src/chainparams.cpp

@ -132,7 +132,6 @@ public:
fDefaultConsistencyChecks = false; fDefaultConsistencyChecks = false;
fRequireStandard = true; fRequireStandard = true;
fMineBlocksOnDemand = false; fMineBlocksOnDemand = false;
fTestnetToBeDeprecatedFieldRPC = false;
checkpointData = (CCheckpointData) { checkpointData = (CCheckpointData) {
boost::assign::map_list_of boost::assign::map_list_of
@ -223,7 +222,6 @@ public:
fDefaultConsistencyChecks = false; fDefaultConsistencyChecks = false;
fRequireStandard = false; fRequireStandard = false;
fMineBlocksOnDemand = false; fMineBlocksOnDemand = false;
fTestnetToBeDeprecatedFieldRPC = true;
checkpointData = (CCheckpointData) { checkpointData = (CCheckpointData) {
boost::assign::map_list_of boost::assign::map_list_of
@ -285,7 +283,6 @@ public:
fDefaultConsistencyChecks = true; fDefaultConsistencyChecks = true;
fRequireStandard = false; fRequireStandard = false;
fMineBlocksOnDemand = true; fMineBlocksOnDemand = true;
fTestnetToBeDeprecatedFieldRPC = false;
checkpointData = (CCheckpointData){ checkpointData = (CCheckpointData){
boost::assign::map_list_of boost::assign::map_list_of

3
src/chainparams.h

@ -67,8 +67,6 @@ public:
uint64_t PruneAfterHeight() const { return nPruneAfterHeight; } uint64_t PruneAfterHeight() const { return nPruneAfterHeight; }
/** Make miner stop after a block is found. In RPC, don't return until nGenProcLimit blocks are generated */ /** Make miner stop after a block is found. In RPC, don't return 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; }
/** 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; }
const std::vector<CDNSSeedData>& DNSSeeds() const { return vSeeds; } const std::vector<CDNSSeedData>& DNSSeeds() const { return vSeeds; }
@ -91,7 +89,6 @@ protected:
bool fDefaultConsistencyChecks; bool fDefaultConsistencyChecks;
bool fRequireStandard; bool fRequireStandard;
bool fMineBlocksOnDemand; bool fMineBlocksOnDemand;
bool fTestnetToBeDeprecatedFieldRPC;
CCheckpointData checkpointData; CCheckpointData checkpointData;
}; };

2
src/rpc/mining.cpp

@ -230,7 +230,6 @@ UniValue getmininginfo(const UniValue& params, bool fHelp)
" \"errors\": \"...\" (string) Current errors\n" " \"errors\": \"...\" (string) Current errors\n"
" \"networkhashps\": nnn, (numeric) The network hashes per second\n" " \"networkhashps\": nnn, (numeric) The network hashes per second\n"
" \"pooledtx\": n (numeric) The size of the mem pool\n" " \"pooledtx\": n (numeric) The size of the mem pool\n"
" \"testnet\": true|false (boolean) If using testnet or not\n"
" \"chain\": \"xxxx\", (string) current network name as defined in BIP70 (main, test, regtest)\n" " \"chain\": \"xxxx\", (string) current network name as defined in BIP70 (main, test, regtest)\n"
"}\n" "}\n"
"\nExamples:\n" "\nExamples:\n"
@ -250,7 +249,6 @@ UniValue getmininginfo(const UniValue& params, bool fHelp)
obj.push_back(Pair("errors", GetWarnings("statusbar"))); obj.push_back(Pair("errors", GetWarnings("statusbar")));
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().TestnetToBeDeprecatedFieldRPC()));
obj.push_back(Pair("chain", Params().NetworkIDString())); obj.push_back(Pair("chain", Params().NetworkIDString()));
return obj; return obj;
} }

2
src/rpc/misc.cpp

@ -93,7 +93,7 @@ UniValue getinfo(const UniValue& params, bool fHelp)
obj.push_back(Pair("connections", (int)g_connman->GetNodeCount(CConnman::CONNECTIONS_ALL))); obj.push_back(Pair("connections", (int)g_connman->GetNodeCount(CConnman::CONNECTIONS_ALL)));
obj.push_back(Pair("proxy", (proxy.IsValid() ? proxy.proxy.ToStringIPPort() : string()))); obj.push_back(Pair("proxy", (proxy.IsValid() ? proxy.proxy.ToStringIPPort() : string())));
obj.push_back(Pair("difficulty", (double)GetDifficulty())); obj.push_back(Pair("difficulty", (double)GetDifficulty()));
obj.push_back(Pair("testnet", Params().TestnetToBeDeprecatedFieldRPC())); obj.push_back(Pair("testnet", Params().NetworkIDString() == CBaseChainParams::TESTNET));
#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