-
Notifications
You must be signed in to change notification settings - Fork 1
/
chainparams.cpp
411 lines (367 loc) · 23.7 KB
/
chainparams.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
// Copyright (c) 2010 Satoshi Nakamoto
// Copyright (c) 2009-2014 The Bitcoin Core developers
// Copyright (c) 199X-2017 The STAP Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "chainparams.h"
#include "consensus/merkle.h"
#include "tinyformat.h"
#include "util.h"
#include "utilstrencodings.h"
#include <assert.h>
#include <boost/assign/list_of.hpp>
#include "chainparamsseeds.h"
static CBlock CreateGenesisBlock(const char* pszTimestamp, const CScript& genesisOutputScript, uint32_t nTime, uint32_t nNonce, uint32_t nBits, int32_t nVersion, const CAmount& genesisReward)
{
CMutableTransaction txNew;
txNew.nVersion = 1;
txNew.vin.resize(1);
txNew.vout.resize(1);
txNew.vin[0].scriptSig = CScript() << 486604799 << CScriptNum(4) << std::vector<unsigned char>((const unsigned char*)pszTimestamp, (const unsigned char*)pszTimestamp + strlen(pszTimestamp));
txNew.vout[0].nValue = genesisReward;
txNew.vout[0].scriptPubKey = genesisOutputScript;
CBlock genesis;
genesis.nTime = nTime;
genesis.nBits = nBits;
genesis.nNonce = nNonce;
genesis.nVersion = nVersion;
genesis.vtx.push_back(txNew);
genesis.hashPrevBlock.SetNull();
genesis.hashMerkleRoot = BlockMerkleRoot(genesis);
return genesis;
}
/**
* Build the genesis block. Note that the output of its generation
* transaction cannot be spent since it did not originally exist in the
* database.
*
* CBlock(hash=00000ffd590b14, ver=1, hashPrevBlock=00000000000000, hashMerkleRoot=e0028e, nTime=1390095618, nBits=1e0ffff0, nNonce=28917698, vtx=1)
* CTransaction(hash=e0028e, ver=1, vin.size=1, vout.size=1, nLockTime=0)
* CTxIn(COutPoint(000000, -1), coinbase 04ffff001d01044c5957697265642030392f4a616e2f3230313420546865204772616e64204578706572696d656e7420476f6573204c6976653a204f76657273746f636b2e636f6d204973204e6f7720416363657074696e6720426974636f696e73)
* CTxOut(nValue=50.00000000, scriptPubKey=0xA9037BAC7050C479B121CF)
* vMerkleTree: e0028e
*/
static CBlock CreateGenesisBlock(uint32_t nTime, uint32_t nNonce, uint32_t nBits, int32_t nVersion, const CAmount& genesisReward)
{
const char* pszTimestamp = "Reuters 13/Sep/2017 Jamie Dimon said Bitcoin is a fraud.";//Wired 09/Jan/2014 The Grand Experiment Goes Live: Overstock.com Is Now Accepting Bitcoins
const CScript genesisOutputScript = CScript() << ParseHex("04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f") << OP_CHECKSIG;//040184710fa689ad5023690c80f3a49c8f13f8d45b8c857fbcbc8bc4a8e4d3eb4b10f4d4604fa08dce601aaf0f470216fe1b51850b4acf21b179c45070ac7b03a9
return CreateGenesisBlock(pszTimestamp, genesisOutputScript, nTime, nNonce, nBits, nVersion, genesisReward);
}
/**
* Main network
*/
/**
* What makes a good checkpoint block?
* + Is surrounded by blocks with reasonable timestamps
* (no blocks before with a timestamp after, none after with
* timestamp before)
* + Contains no strange transactions
*/
class CMainParams : public CChainParams {
public:
CMainParams() {
strNetworkID = "main";
consensus.nSubsidyHalvingInterval = 788400; // Note: actual number of blocks per calendar year with DGW v3 is ~200700 (for example 449750 - 249050)
consensus.nMasternodePaymentsStartBlock = 1; //100000 not true, but it's ok as long as it's less then nMasternodePaymentsIncreaseBlock
consensus.nMasternodePaymentsIncreaseBlock = 158000; // actual historical value
consensus.nMasternodePaymentsIncreasePeriod = 576*30; // 17280 - actual historical value
consensus.nInstantSendKeepLock = 24;
consensus.nBudgetPaymentsStartBlock = 1; //328008 actual historical value
consensus.nBudgetPaymentsCycleBlocks = 21600; //16616 ~(60*24*30)/2.6, actual number of blocks per month is 200700 / 12 = 16725
consensus.nBudgetPaymentsWindowBlocks = 100;
consensus.nBudgetProposalEstablishingTime = 60*60*24;
consensus.nSuperblockStartBlock = 1; //614820 The block at which 12.1 goes live (end of final 12.0 budget cycle)
consensus.nSuperblockCycle = 21600; //16616 ~(60*24*30)/2.6, actual number of blocks per month is 200700 / 12 = 16725
consensus.nGovernanceMinQuorum = 10;
consensus.nGovernanceFilterElements = 20000;
consensus.nMasternodeMinimumConfirmations = 15;
consensus.nMajorityEnforceBlockUpgrade = 750;
consensus.nMajorityRejectBlockOutdated = 950;
consensus.nMajorityWindow = 1000;
consensus.BIP34Height = 0;//227931;
consensus.BIP34Hash = uint256S("0x0000091add4307bb66f2cbd07408338e472e7a07dcad4215cd40795402f13ea0");//0x000000000000024b89b42a942fe0d9fea3bb44ab7bd1b19115dd6a759c0808b8
consensus.powLimit = uint256S("00000fffff000000000000000000000000000000000000000000000000000000");
consensus.nPowTargetTimespan = 24 * 60 * 60; // STAP: 1 day
consensus.nPowTargetSpacing = 2.0 * 60; //2.5 STAP: 2.0 minutes
consensus.fPowAllowMinDifficultyBlocks = false;
consensus.fPowNoRetargeting = false;
consensus.nRuleChangeActivationThreshold = 1916; // 95% of 2016
consensus.nMinerConfirmationWindow = 2016; // nPowTargetTimespan / nPowTargetSpacing
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28;
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 1199145601; // January 1, 2008
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = 1230767999; // December 31, 2008
// Deployment of BIP68, BIP112, and BIP113.
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].bit = 0;
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nStartTime = 1505557879; // 2017-09-16
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nTimeout = 1537093879; // 2018-09-16
/**
* The message start string is designed to be unlikely to occur in normal data.
* The characters are rarely used upper ASCII, not valid as UTF-8, and produce
* a large 32-bit integer with any alignment.
*/
pchMessageStart[0] = 0xb6;//
pchMessageStart[1] = 0xdb;//
pchMessageStart[2] = 0xfb;//
pchMessageStart[3] = 0xc0;//
vAlertPubKey = ParseHex("0424b0747fd86f094719ef1b584790d9a863194f4dcfa91530b2f7b06775e3af7604602ee974123ddb5836f281b362c2319d2ead7395864b8396c2a2e204662acd");
nDefaultPort = 9669;
nMaxTipAge = 6 * 60 * 60; // ~144 blocks behind -> 2 x fork detection time, was 24 * 60 * 60 in bitcoin
nPruneAfterHeight = 100000;
genesis = CreateGenesisBlock(1505552276, 1553826, 0x1e0ffff0, 1, 50 * COIN);//CreateGenesisBlock(1390095618, 28917698, 0x1e0ffff0, 1, 50 * COIN);
consensus.hashGenesisBlock = genesis.GetHash();
assert(consensus.hashGenesisBlock == uint256S("0x0000091add4307bb66f2cbd07408338e472e7a07dcad4215cd40795402f13ea0"));
assert(genesis.hashMerkleRoot == uint256S("0x2b6fce1f826852f0d6b7d97b18a2c4f17c2e642dffccffd7fbbc81b1e24abdcd"));
vSeeds.clear();//vSeeds.push_back(CDNSSeedData("stap.org", "dnsseed.stap.org"));
// vSeeds.push_back(CDNSSeedData("dashdot.io", "dnsseed.dashdot.io"));
// vSeeds.push_back(CDNSSeedData("masternode.io", "dnsseed.masternode.io"));
// vSeeds.push_back(CDNSSeedData("dashpay.io", "dnsseed.dashpay.io"));
// STAP addresses start with 'S'
base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,63);
// STAP script addresses start with '9'
base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,21);
// STAP private keys start with '?' or '?'
base58Prefixes[SECRET_KEY] = std::vector<unsigned char>(1,205);
// STAP BIP32 pubkeys start with 'xpub' (Bitcoin defaults)
base58Prefixes[EXT_PUBLIC_KEY] = boost::assign::list_of(0x04)(0x88)(0xB2)(0x1E).convert_to_container<std::vector<unsigned char> >();
// STAP BIP32 prvkeys start with 'xprv' (Bitcoin defaults)
base58Prefixes[EXT_SECRET_KEY] = boost::assign::list_of(0x04)(0x88)(0xAD)(0xE4).convert_to_container<std::vector<unsigned char> >();
// STAP BIP44 coin type is '5'
base58Prefixes[EXT_COIN_TYPE] = boost::assign::list_of(0x80)(0x00)(0x00)(0x05).convert_to_container<std::vector<unsigned char> >();
vFixedSeeds = std::vector<SeedSpec6>(pnSeed6_main, pnSeed6_main + ARRAYLEN(pnSeed6_main));
fMiningRequiresPeers = true;
fDefaultConsistencyChecks = false;
fRequireStandard = true;
fMineBlocksOnDemand = true;
fTestnetToBeDeprecatedFieldRPC = false;
nPoolMaxTransactions = 3;
nFulfilledRequestExpireTime = 60*60; // fulfilled requests expire in 1 hour
strSporkPubKey = "04087e5b440e275a055158691848dbb2e634b6f3f88ee66427d83cbd3da18a3077ab69b6698ee3e55bbea760f8aefd8c9ab713c5b8b38ab2aaac47a60a617a1705";
strMasternodePaymentsPubKey = "04087e5b440e275a055158691848dbb2e634b6f3f88ee66427d83cbd3da18a3077ab69b6698ee3e55bbea760f8aefd8c9ab713c5b8b38ab2aaac47a60a617a1705";
checkpointData = (CCheckpointData) {
boost::assign::map_list_of
/* ( 1500, uint256S("0x000000aaf0300f59f49bc3e970bad15c11f961fe2347accffff19d96ec9778e3"))
( 4991, uint256S("0x000000003b01809551952460744d5dbb8fcbd6cbae3c220267bf7fa43f837367"))
( 9918, uint256S("0x00000000213e229f332c0ffbe34defdaa9e74de87f2d8d1f01af8d121c3c170b"))
( 16912, uint256S("0x00000000075c0d10371d55a60634da70f197548dbbfa4123e12abfcbc5738af9"))
( 23912, uint256S("0x0000000000335eac6703f3b1732ec8b2f89c3ba3a7889e5767b090556bb9a276"))
( 35457, uint256S("0x0000000000b0ae211be59b048df14820475ad0dd53b9ff83b010f71a77342d9f"))
( 45479, uint256S("0x000000000063d411655d590590e16960f15ceea4257122ac430c6fbe39fbf02d"))
( 55895, uint256S("0x0000000000ae4c53a43639a4ca027282f69da9c67ba951768a20415b6439a2d7"))
( 68899, uint256S("0x0000000000194ab4d3d9eeb1f2f792f21bb39ff767cb547fe977640f969d77b7"))
( 74619, uint256S("0x000000000011d28f38f05d01650a502cc3f4d0e793fbc26e2a2ca71f07dc3842"))
( 75095, uint256S("0x0000000000193d12f6ad352a9996ee58ef8bdc4946818a5fec5ce99c11b87f0d"))
( 88805, uint256S("0x00000000001392f1652e9bf45cd8bc79dc60fe935277cd11538565b4a94fa85f"))
( 107996, uint256S("0x00000000000a23840ac16115407488267aa3da2b9bc843e301185b7d17e4dc40"))
( 137993, uint256S("0x00000000000cf69ce152b1bffdeddc59188d7a80879210d6e5c9503011929c3c"))
( 167996, uint256S("0x000000000009486020a80f7f2cc065342b0c2fb59af5e090cd813dba68ab0fed"))
( 207992, uint256S("0x00000000000d85c22be098f74576ef00b7aa00c05777e966aff68a270f1e01a5"))
( 312645, uint256S("0x0000000000059dcb71ad35a9e40526c44e7aae6c99169a9e7017b7d84b1c2daf"))
( 407452, uint256S("0x000000000003c6a87e73623b9d70af7cd908ae22fee466063e4ffc20be1d2dbc"))
( 523412, uint256S("0x000000000000e54f036576a10597e0e42cc22a5159ce572f999c33975e121d4d"))*/
( 1500, uint256S("0x0000033199b3d0546287867bbdc1216f5cfa0aac7eb3c87f47dc8f82d4c935c4"))//( 523930, uint256S("0x0000000000000bccdb11c2b1cfb0ecab452abf267d89b7f46eaf2d54ce6e652c")),
( 7709, uint256S("0x00000000004acbba46a84c9c228dc1eced776d93353f71ba02d921b75bbba765"))
( 12822, uint256S("0x00000000015a5091742306ff8c8c2014022c3d4c889ca6d3593c812aed5b0499")),
1507035080,//1505552276,//1471809614, // * UNIX timestamp of last checkpoint block
13275,//1998064, // * total number of transactions between genesis and last checkpoint
// (the tx=... number in the SetBestChain debug.log lines)
720//2800 // * estimated number of transactions per day after checkpoint
};
}
};
static CMainParams mainParams;
/**
* Testnet (v3)
*/
class CTestNetParams : public CChainParams {
public:
CTestNetParams() {
strNetworkID = "test";
consensus.nSubsidyHalvingInterval = 210240;
consensus.nMasternodePaymentsStartBlock = 10000; // not true, but it's ok as long as it's less then nMasternodePaymentsIncreaseBlock
consensus.nMasternodePaymentsIncreaseBlock = 46000;
consensus.nMasternodePaymentsIncreasePeriod = 576;
consensus.nInstantSendKeepLock = 6;
consensus.nBudgetPaymentsStartBlock = 60000;
consensus.nBudgetPaymentsCycleBlocks = 50;
consensus.nBudgetPaymentsWindowBlocks = 10;
consensus.nBudgetProposalEstablishingTime = 60*20;
consensus.nSuperblockStartBlock = 61000; // NOTE: Should satisfy nSuperblockStartBlock > nBudgetPeymentsStartBlock
consensus.nSuperblockCycle = 24; // Superblocks can be issued hourly on testnet
consensus.nGovernanceMinQuorum = 1;
consensus.nGovernanceFilterElements = 500;
consensus.nMasternodeMinimumConfirmations = 1;
consensus.nMajorityEnforceBlockUpgrade = 51;
consensus.nMajorityRejectBlockOutdated = 75;
consensus.nMajorityWindow = 100;
consensus.BIP34Height = 0;//
consensus.BIP34Hash = uint256S("0x00000d6d63b6656e9ab433eb104170f490d894a871392785a33ac7c31ed1d5b6");//0x0000000023b3a96d3484e5abb3755c413e7d41500f8e2a5c3f0dd01299cd8ef8
consensus.powLimit = uint256S("00000fffff000000000000000000000000000000000000000000000000000000");
consensus.nPowTargetTimespan = 24 * 60 * 60; // STAP: 1 day
consensus.nPowTargetSpacing = 2.5 * 60; // STAP: 2.5 minutes
consensus.fPowAllowMinDifficultyBlocks = true;
consensus.fPowNoRetargeting = false;
consensus.nRuleChangeActivationThreshold = 1512; // 75% for testchains
consensus.nMinerConfirmationWindow = 2016; // nPowTargetTimespan / nPowTargetSpacing
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28;
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 1199145601; // January 1, 2008
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = 1230767999; // December 31, 2008
// Deployment of BIP68, BIP112, and BIP113.
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].bit = 0;
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nStartTime = 1456790400; // March 1st, 2016
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nTimeout = 1493596800; // May 1st, 2017
pchMessageStart[0] = 0xff;//
pchMessageStart[1] = 0xca;//
pchMessageStart[2] = 0xe2;//
pchMessageStart[3] = 0xce;//
vAlertPubKey = ParseHex("047492b1ef597c2b15825e097313b5b74602079fcd6d88f61ce2f5557f56c729b81b82dce39fa59f19585dc0f3650c7a0b9225ec2e94d85c59bac10fd6950d5644");
nDefaultPort = 19669;
nMaxTipAge = 0x7fffffff; // allow mining on top of old blocks for testnet
nPruneAfterHeight = 1000;
genesis = CreateGenesisBlock(1505552684UL, 1417511UL, 0x1e0ffff0, 1, 50 * COIN);
consensus.hashGenesisBlock = genesis.GetHash();
assert(consensus.hashGenesisBlock == uint256S("0x00000d6d63b6656e9ab433eb104170f490d894a871392785a33ac7c31ed1d5b6"));//00000bafbc94add76cb75e2ec92894837288a481e5c005f6563d91623bf8bc2c
assert(genesis.hashMerkleRoot == uint256S("0x2b6fce1f826852f0d6b7d97b18a2c4f17c2e642dffccffd7fbbc81b1e24abdcd"));
vFixedSeeds.clear();
vSeeds.clear();
// vSeeds.push_back(CDNSSeedData("dashdot.io", "testnet-seed.dashdot.io"));
// vSeeds.push_back(CDNSSeedData("masternode.io", "test.dnsseed.masternode.io"));
// Testnet STAP addresses start with 's'
base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,125);
// Testnet STAP script addresses start with '8' or '9'
base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,19);
// Testnet private keys start with '9' or 'c' (Bitcoin defaults)
base58Prefixes[SECRET_KEY] = std::vector<unsigned char>(1,239);
// Testnet STAP BIP32 pubkeys start with 'tpub' (Bitcoin defaults)
base58Prefixes[EXT_PUBLIC_KEY] = boost::assign::list_of(0x04)(0x35)(0x87)(0xCF).convert_to_container<std::vector<unsigned char> >();
// Testnet STAP BIP32 prvkeys start with 'tprv' (Bitcoin defaults)
base58Prefixes[EXT_SECRET_KEY] = boost::assign::list_of(0x04)(0x35)(0x83)(0x94).convert_to_container<std::vector<unsigned char> >();
// Testnet STAP BIP44 coin type is '1' (All coin's testnet default)
base58Prefixes[EXT_COIN_TYPE] = boost::assign::list_of(0x80)(0x00)(0x00)(0x01).convert_to_container<std::vector<unsigned char> >();
vFixedSeeds = std::vector<SeedSpec6>(pnSeed6_test, pnSeed6_test + ARRAYLEN(pnSeed6_test));
fMiningRequiresPeers = true;
fDefaultConsistencyChecks = false;
fRequireStandard = false;
fMineBlocksOnDemand = false;
fTestnetToBeDeprecatedFieldRPC = true;
nPoolMaxTransactions = 3;
nFulfilledRequestExpireTime = 5*60; // fulfilled requests expire in 5 minutes
strSporkPubKey = "04087e5b440e275a055158691848dbb2e634b6f3f88ee66427d83cbd3da18a3077ab69b6698ee3e55bbea760f8aefd8c9ab713c5b8b38ab2aaac47a60a617a1705";
strMasternodePaymentsPubKey = "04087e5b440e275a055158691848dbb2e634b6f3f88ee66427d83cbd3da18a3077ab69b6698ee3e55bbea760f8aefd8c9ab713c5b8b38ab2aaac47a60a617a1705";
checkpointData = (CCheckpointData) {
boost::assign::map_list_of
// ( 261, uint256S("0x00000c26026d0815a7e2ce4fa270775f61403c040647ff2c3091f99e894a4618"))
// ( 1999, uint256S("0x00000052e538d27fa53693efe6fb6892a0c1d26c0235f599171c48a3cce553b1"))
// ( 2999, uint256S("0x0000024bc3f4f4cb30d29827c13d921ad77d2c6072e586c7f60d83c2722cdcc5"))
// ( 12907, uint256S("0x00000067de20fd6d276ee0839a3187b203accaa5aad04ca5c17c2997e2730e4c"))
// ( 15590, uint256S("0x00000009df8f2ee9c230aef9dad257d82bde20ca83378a208ce5d95d29a78852"))
// ( 65900, uint256S("0x00000063e4e94d75d0dc075e93898444c8ef50655990dfff7c32d92a7efff671"))
( 0, uint256S("0x00000d6d63b6656e9ab433eb104170f490d894a871392785a33ac7c31ed1d5b6")),//( 127618, uint256S("0x0000002104a2c1fc923b0e3b74b1860236fbc2b4479a833c28abaf456ea4e466")),
1505552684,//1483076495, // * UNIX timestamp of last checkpoint block
0,//168590, // * total number of transactions between genesis and last checkpoint
// (the tx=... number in the SetBestChain debug.log lines)
500 // * estimated number of transactions per day after checkpoint
};
}
};
static CTestNetParams testNetParams;
/**
* Regression test
*/
class CRegTestParams : public CChainParams {
public:
CRegTestParams() {
strNetworkID = "regtest";
consensus.nSubsidyHalvingInterval = 150;
consensus.nMasternodePaymentsStartBlock = 240;
consensus.nMasternodePaymentsIncreaseBlock = 350;
consensus.nMasternodePaymentsIncreasePeriod = 10;
consensus.nInstantSendKeepLock = 6;
consensus.nBudgetPaymentsStartBlock = 1000;
consensus.nBudgetPaymentsCycleBlocks = 50;
consensus.nBudgetPaymentsWindowBlocks = 10;
consensus.nBudgetProposalEstablishingTime = 60*20;
consensus.nSuperblockStartBlock = 1500;
consensus.nSuperblockCycle = 10;
consensus.nGovernanceMinQuorum = 1;
consensus.nGovernanceFilterElements = 100;
consensus.nMasternodeMinimumConfirmations = 1;
consensus.nMajorityEnforceBlockUpgrade = 750;
consensus.nMajorityRejectBlockOutdated = 950;
consensus.nMajorityWindow = 1000;
consensus.BIP34Height = -1; // BIP34 has not necessarily activated on regtest
consensus.BIP34Hash = uint256();
consensus.powLimit = uint256S("7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
consensus.nPowTargetTimespan = 24 * 60 * 60; // STAP: 1 day
consensus.nPowTargetSpacing = 2.5 * 60; // STAP: 2.5 minutes
consensus.fPowAllowMinDifficultyBlocks = true;
consensus.fPowNoRetargeting = true;
consensus.nRuleChangeActivationThreshold = 108; // 75% for testchains
consensus.nMinerConfirmationWindow = 144; // Faster than normal for regtest (144 instead of 2016)
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28;
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 0;
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = 999999999999ULL;
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].bit = 0;
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nStartTime = 0;
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nTimeout = 999999999999ULL;
pchMessageStart[0] = 0xdc;//
pchMessageStart[1] = 0xb7;//
pchMessageStart[2] = 0xc1;//
pchMessageStart[3] = 0xfc;//
nMaxTipAge = 6 * 60 * 60; // ~144 blocks behind -> 2 x fork detection time, was 24 * 60 * 60 in bitcoin
nDefaultPort = 19994;
nPruneAfterHeight = 1000;
genesis = CreateGenesisBlock(1505552951, 1, 0x207fffff, 1, 50 * COIN);
consensus.hashGenesisBlock = genesis.GetHash();
assert(consensus.hashGenesisBlock == uint256S("0x332dbcd9e1f40af03d9720bfb54e56afb821107b2609bdb511c020bc3302a1b9"));
assert(genesis.hashMerkleRoot == uint256S("0x2b6fce1f826852f0d6b7d97b18a2c4f17c2e642dffccffd7fbbc81b1e24abdcd"));//e0028eb9648db56b1ac77cf090b99048a8007e2bb64b68f092c03c7f56a662c7
vFixedSeeds.clear(); //! Regtest mode doesn't have any fixed seeds.
vSeeds.clear(); //! Regtest mode doesn't have any DNS seeds.
fMiningRequiresPeers = false;
fDefaultConsistencyChecks = true;
fRequireStandard = false;
fMineBlocksOnDemand = true;
fTestnetToBeDeprecatedFieldRPC = false;
nFulfilledRequestExpireTime = 5*60; // fulfilled requests expire in 5 minutes
checkpointData = (CCheckpointData){
boost::assign::map_list_of
( 0, uint256S("0x332dbcd9e1f40af03d9720bfb54e56afb821107b2609bdb511c020bc3302a1b9")),
0,
0,
0
};
// Regtest STAP addresses start with 'y'
base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,140);
// Regtest STAP script addresses start with '8' or '9'
base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,19);
// Regtest private keys start with '9' or 'c' (Bitcoin defaults)
base58Prefixes[SECRET_KEY] = std::vector<unsigned char>(1,239);
// Regtest STAP BIP32 pubkeys start with 'tpub' (Bitcoin defaults)
base58Prefixes[EXT_PUBLIC_KEY] = boost::assign::list_of(0x04)(0x35)(0x87)(0xCF).convert_to_container<std::vector<unsigned char> >();
// Regtest STAP BIP32 prvkeys start with 'tprv' (Bitcoin defaults)
base58Prefixes[EXT_SECRET_KEY] = boost::assign::list_of(0x04)(0x35)(0x83)(0x94).convert_to_container<std::vector<unsigned char> >();
// Regtest STAP BIP44 coin type is '1' (All coin's testnet default)
base58Prefixes[EXT_COIN_TYPE] = boost::assign::list_of(0x80)(0x00)(0x00)(0x01).convert_to_container<std::vector<unsigned char> >();
}
};
static CRegTestParams regTestParams;
static CChainParams *pCurrentParams = 0;
const CChainParams &Params() {
assert(pCurrentParams);
return *pCurrentParams;
}
CChainParams& Params(const std::string& chain)
{
if (chain == CBaseChainParams::MAIN)
return mainParams;
else if (chain == CBaseChainParams::TESTNET)
return testNetParams;
else if (chain == CBaseChainParams::REGTEST)
return regTestParams;
else
throw std::runtime_error(strprintf("%s: Unknown chain %s.", __func__, chain));
}
void SelectParams(const std::string& network)
{
SelectBaseParams(network);
pCurrentParams = &Params(network);
}