diff options
-rw-r--r-- | src/chainparams.cpp | 3 | ||||
-rw-r--r-- | src/chainparams.h | 3 | ||||
-rw-r--r-- | src/init.cpp | 13 | ||||
-rw-r--r-- | src/rpcblockchain.cpp | 2 | ||||
-rw-r--r-- | src/rpcmining.cpp | 4 | ||||
-rw-r--r-- | src/rpcmisc.cpp | 2 |
6 files changed, 15 insertions, 12 deletions
diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 6b2cfa1d1f..31eac62d48 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -178,7 +178,6 @@ public: fDefaultCheckMemPool = false; fAllowMinDifficultyBlocks = false; fRequireStandard = true; - fRPCisTestNet = false; fMineBlocksOnDemand = false; } }; @@ -230,7 +229,6 @@ public: fDefaultCheckMemPool = false; fAllowMinDifficultyBlocks = true; fRequireStandard = false; - fRPCisTestNet = true; fMineBlocksOnDemand = false; } }; @@ -269,7 +267,6 @@ public: fDefaultCheckMemPool = true; fAllowMinDifficultyBlocks = true; fRequireStandard = false; - fRPCisTestNet = true; fMineBlocksOnDemand = true; } }; diff --git a/src/chainparams.h b/src/chainparams.h index 28a51cbb0c..c0a6ebda6b 100644 --- a/src/chainparams.h +++ b/src/chainparams.h @@ -70,8 +70,6 @@ public: bool AllowMinDifficultyBlocks() const { return fAllowMinDifficultyBlocks; } /* Make standard checks */ bool RequireStandard() const { return fRequireStandard; } - /* Make standard checks */ - bool RPCisTestNet() const { return fRPCisTestNet; } const std::string& DataDir() const { return strDataDir; } /* Make miner stop after a block is found. In RPC, don't return * until nGenProcLimit blocks are generated */ @@ -110,7 +108,6 @@ protected: bool fDefaultCheckMemPool; bool fAllowMinDifficultyBlocks; bool fRequireStandard; - bool fRPCisTestNet; bool fMineBlocksOnDemand; }; diff --git a/src/init.cpp b/src/init.cpp index 39453da9c8..6ad2c58c8f 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -195,8 +195,9 @@ bool static Bind(const CService &addr, unsigned int flags) { return true; } -std::string HelpMessage(HelpMessageMode hmm) +std::string HelpMessage(HelpMessageMode mode) { + // When adding new options to the categories, please keep and ensure alphabetical ordering. string strUsage = _("Options:") + "\n"; strUsage += " -? " + _("This help message") + "\n"; strUsage += " -alertnotify=<cmd> " + _("Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)") + "\n"; @@ -204,7 +205,7 @@ std::string HelpMessage(HelpMessageMode hmm) strUsage += " -checkblocks=<n> " + _("How many blocks to check at startup (default: 288, 0 = all)") + "\n"; strUsage += " -checklevel=<n> " + _("How thorough the block verification of -checkblocks is (0-4, default: 3)") + "\n"; strUsage += " -conf=<file> " + _("Specify configuration file (default: bitcoin.conf)") + "\n"; - if (hmm == HMM_BITCOIND) + if (mode == HMM_BITCOIND) { #if !defined(WIN32) strUsage += " -daemon " + _("Run in the background as a daemon and accept commands") + "\n"; @@ -273,12 +274,13 @@ std::string HelpMessage(HelpMessageMode hmm) strUsage += " -dropmessagestest=<n> " + _("Randomly drop 1 of every <n> network messages") + "\n"; strUsage += " -fuzzmessagestest=<n> " + _("Randomly fuzz 1 of every <n> network messages") + "\n"; strUsage += " -flushwallet " + _("Run a thread to flush wallet periodically (default: 1)") + "\n"; + strUsage += " -stopafterblockimport " + _("Stop running after importing blocks from disk (default: 0)") + "\n"; } strUsage += " -debug=<category> " + _("Output debugging information (default: 0, supplying <category> is optional)") + "\n"; strUsage += " " + _("If <category> is not supplied, output all debugging information.") + "\n"; strUsage += " " + _("<category> can be:"); strUsage += " addrman, alert, coindb, db, lock, rand, rpc, selectcoins, mempool, net"; // Don't translate these and qt below - if (hmm == HMM_BITCOIN_QT) + if (mode == HMM_BITCOIN_QT) strUsage += ", qt"; strUsage += ".\n"; strUsage += " -gen " + _("Generate coins (default: 0)") + "\n"; @@ -404,6 +406,11 @@ void ThreadImport(std::vector<boost::filesystem::path> vImportFiles) LogPrintf("Warning: Could not open blocks file %s\n", path.string()); } } + + if (GetBoolArg("-stopafterblockimport", false)) { + LogPrintf("Stopping after block import\n"); + StartShutdown(); + } } /** Sanity checks diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index 0fabc86872..580c6bd5ba 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -438,7 +438,7 @@ Value getblockchaininfo(const Array& params, bool fHelp) "Returns an object containing various state info regarding block chain processing.\n" "\nResult:\n" "{\n" - " \"chain\": \"xxxx\", (string) current chain (main, testnet3, regtest)\n" + " \"chain\": \"xxxx\", (string) current network name as defined in BIP70 (main, test, regtest)\n" " \"blocks\": xxxxxx, (numeric) the current number of blocks processed in the server\n" " \"bestblockhash\": \"...\", (string) the hash of the currently best block\n" " \"difficulty\": xxxxxx, (numeric) the current difficulty\n" diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp index 3caf7d89fe..57a51c0fde 100644 --- a/src/rpcmining.cpp +++ b/src/rpcmining.cpp @@ -253,6 +253,7 @@ Value getmininginfo(const Array& params, bool fHelp) " \"hashespersec\": n (numeric) The hashes per second of the generation, or 0 if no generation.\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" "}\n" "\nExamples:\n" + HelpExampleCli("getmininginfo", "") @@ -268,7 +269,8 @@ 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().RPCisTestNet())); + obj.push_back(Pair("testnet", Params().NetworkID() == CChainParams::TESTNET)); + obj.push_back(Pair("chain", Params().NetworkIDString())); #ifdef ENABLE_WALLET obj.push_back(Pair("generate", getgenerate(params, false))); obj.push_back(Pair("hashespersec", gethashespersec(params, false))); diff --git a/src/rpcmisc.cpp b/src/rpcmisc.cpp index 77e0e09ec3..5181aa23d8 100644 --- a/src/rpcmisc.cpp +++ b/src/rpcmisc.cpp @@ -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", Params().RPCisTestNet())); + obj.push_back(Pair("testnet", Params().NetworkID() == CChainParams::TESTNET)); #ifdef ENABLE_WALLET if (pwalletMain) { obj.push_back(Pair("keypoololdest", pwalletMain->GetOldestKeyPoolTime())); |