66#include " chainparams.h"
77
88#include " assert.h"
9- #include " core.h"
10- #include " protocol.h"
119#include " util.h"
1210
1311#include < boost/assign/list_of.hpp>
@@ -100,6 +98,7 @@ unsigned int pnSeed[] =
10098class CMainParams : public CChainParams {
10199public:
102100 CMainParams () {
101+ networkID = CChainParams::MAIN;
103102 // The message start string is designed to be unlikely to occur in normal data.
104103 // The characters are rarely used upper ASCII, not valid as UTF-8, and produce
105104 // a large 4-byte int at any alignment.
@@ -171,27 +170,25 @@ class CMainParams : public CChainParams {
171170 addr.nTime = GetTime () - GetRand (nOneWeek) - nOneWeek;
172171 vFixedSeeds.push_back (addr);
173172 }
174- }
175-
176- virtual const CBlock& GenesisBlock () const { return genesis; }
177- virtual Network NetworkID () const { return CChainParams::MAIN; }
178173
179- virtual const vector<CAddress>& FixedSeeds () const {
180- return vFixedSeeds;
174+ fRequireRPCPassword = true ;
175+ fMiningRequiresPeers = true ;
176+ fDefaultCheckMemPool = false ;
177+ fAllowMinDifficultyBlocks = false ;
178+ fRequireStandard = true ;
179+ fRPCisTestNet = false ;
180+ fMineBlocksOnDemand = false ;
181181 }
182- protected:
183- CBlock genesis;
184- vector<CAddress> vFixedSeeds;
185182};
186183static CMainParams mainParams;
187184
188-
189185//
190186// Testnet (v3)
191187//
192188class CTestNetParams : public CMainParams {
193189public:
194190 CTestNetParams () {
191+ networkID = CChainParams::TESTNET;
195192 // The message start string is designed to be unlikely to occur in normal data.
196193 // The characters are rarely used upper ASCII, not valid as UTF-8, and produce
197194 // a large 4-byte int at any alignment.
@@ -223,22 +220,25 @@ class CTestNetParams : public CMainParams {
223220 base58Prefixes[SECRET_KEY] = list_of (239 );
224221 base58Prefixes[EXT_PUBLIC_KEY] = list_of (0x04 )(0x35 )(0x87 )(0xCF );
225222 base58Prefixes[EXT_SECRET_KEY] = list_of (0x04 )(0x35 )(0x83 )(0x94 );
226- }
227223
228- virtual bool AllowMinDifficultyBlocks () const { return true ; }
229- virtual bool RequireStandard () const { return false ; }
230- virtual bool RPCisTestNet () const { return true ; }
231- virtual Network NetworkID () const { return CChainParams::TESTNET; }
224+ fRequireRPCPassword = true ;
225+ fMiningRequiresPeers = true ;
226+ fDefaultCheckMemPool = false ;
227+ fAllowMinDifficultyBlocks = true ;
228+ fRequireStandard = false ;
229+ fRPCisTestNet = true ;
230+ fMineBlocksOnDemand = false ;
231+ }
232232};
233233static CTestNetParams testNetParams;
234234
235-
236235//
237236// Regression test
238237//
239238class CRegTestParams : public CTestNetParams {
240239public:
241240 CRegTestParams () {
241+ networkID = CChainParams::REGTEST;
242242 pchMessageStart[0 ] = 0xfa ;
243243 pchMessageStart[1 ] = 0xbf ;
244244 pchMessageStart[2 ] = 0xb5 ;
@@ -258,14 +258,15 @@ class CRegTestParams : public CTestNetParams {
258258 assert (hashGenesisBlock == uint256 (" 0x0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206" ));
259259
260260 vSeeds.clear (); // Regtest mode doesn't have any DNS seeds.
261- }
262261
263- virtual bool RequireRPCPassword () const { return false ; }
264- virtual bool MiningRequiresPeers () const { return false ; }
265- virtual bool MineBlocksOnDemand () const { return true ; }
266- virtual bool DefaultCheckMemPool () const { return true ; }
267- virtual bool RequireStandard () const { return false ; }
268- virtual Network NetworkID () const { return CChainParams::REGTEST; }
262+ fRequireRPCPassword = false ;
263+ fMiningRequiresPeers = false ;
264+ fDefaultCheckMemPool = true ;
265+ fAllowMinDifficultyBlocks = true ;
266+ fRequireStandard = false ;
267+ fRPCisTestNet = true ;
268+ fMineBlocksOnDemand = true ;
269+ }
269270};
270271static CRegTestParams regTestParams;
271272
0 commit comments