diff options
author | Mike Hearn <hearn@google.com> | 2013-05-07 15:16:25 +0200 |
---|---|---|
committer | Mike Hearn <hearn@google.com> | 2013-06-19 16:28:52 +0200 |
commit | 0e4b31755534fac4ea6c20a60f719e3694252220 (patch) | |
tree | 80f576f67c855485e5d82007b98a45536bbf2f9a /src/util.cpp | |
parent | 70e7fba06da36218688a4cae4a5d12332c714247 (diff) |
Introduce a CChainParameters singleton class and regtest mode.
The new class is accessed via the Params() method and holds
most things that vary between main, test and regtest networks.
The regtest mode has two purposes, one is to run the
bitcoind/bitcoinj comparison tool which compares two separate
implementations of the Bitcoin protocol looking for divergence.
The other is that when run, you get a local node which can mine
a single block instantly, which is highly convenient for testing
apps during development as there's no need to wait 10 minutes for
a block on the testnet.
Diffstat (limited to 'src/util.cpp')
-rw-r--r-- | src/util.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/util.cpp b/src/util.cpp index f4892a2387..bfb6d75838 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -13,6 +13,7 @@ #include <sys/resource.h> #endif +#include "chainparams.h" #include "util.h" #include "sync.h" #include "version.h" @@ -78,7 +79,6 @@ bool fDaemon = false; bool fServer = false; bool fCommandLine = false; string strMiscWarning; -bool fTestNet = false; bool fNoListen = false; bool fLogTimestamps = false; CMedianFilter<int64> vTimeOffsets(200,0); @@ -1068,8 +1068,8 @@ const boost::filesystem::path &GetDataDir(bool fNetSpecific) } else { path = GetDefaultDataDir(); } - if (fNetSpecific && GetBoolArg("-testnet", false)) - path /= "testnet3"; + if (fNetSpecific) + path /= Params().DataDir(); fs::create_directories(path); |