mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 23:18:14 +01:00
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.
This commit is contained in:
@@ -70,7 +70,6 @@ extern CCriticalSection cs_main;
|
||||
extern std::map<uint256, CBlockIndex*> mapBlockIndex;
|
||||
extern std::vector<CBlockIndex*> vBlockIndexByHeight;
|
||||
extern std::set<CBlockIndex*, CBlockIndexWorkComparator> setBlockIndexValid;
|
||||
extern uint256 hashGenesisBlock;
|
||||
extern CBlockIndex* pindexGenesisBlock;
|
||||
extern int nBestHeight;
|
||||
extern uint256 nBestChainWork;
|
||||
@@ -86,7 +85,6 @@ extern int64 nHPSTimerStart;
|
||||
extern int64 nTimeBestReceived;
|
||||
extern CCriticalSection cs_setpwalletRegistered;
|
||||
extern std::set<CWallet*> setpwalletRegistered;
|
||||
extern unsigned char pchMessageStart[4];
|
||||
extern bool fImporting;
|
||||
extern bool fReindex;
|
||||
extern bool fBenchmark;
|
||||
@@ -353,7 +351,7 @@ public:
|
||||
|
||||
// Write index header
|
||||
unsigned int nSize = fileout.GetSerializeSize(*this);
|
||||
fileout << FLATDATA(pchMessageStart) << nSize;
|
||||
fileout << FLATDATA(Params().MessageStart()) << nSize;
|
||||
|
||||
// Write undo data
|
||||
long fileOutPos = ftell(fileout);
|
||||
@@ -692,7 +690,7 @@ public:
|
||||
|
||||
// Write index header
|
||||
unsigned int nSize = fileout.GetSerializeSize(*this);
|
||||
fileout << FLATDATA(pchMessageStart) << nSize;
|
||||
fileout << FLATDATA(Params().MessageStart()) << nSize;
|
||||
|
||||
// Write block
|
||||
long fileOutPos = ftell(fileout);
|
||||
|
||||
Reference in New Issue
Block a user