-
Notifications
You must be signed in to change notification settings - Fork 7
/
chainparams.cpp
539 lines (435 loc) · 25 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
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
// Copyright (c) 2010 Satoshi Nakamoto
// Copyright (c) 2009-2017 The Bitcoin Core developers
// Copyright (c) 2017 The Dash developers
// Copyright (c) 2017-2018 WEYCOIN 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 "hash.h"
#include "base58.h"
#include <assert.h>
#include <boost/assign/list_of.hpp>
#include "chainparamsseeds.h"
#include "arith_uint256.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(MakeTransactionRef(std::move(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.
*/
static CBlock CreateGenesisBlock(uint32_t nTime, uint32_t nNonce, uint32_t nBits, int32_t nVersion, const CAmount& genesisReward)
{
const char* pszTimestamp = "At 20/Jan/2018, 11:59PM, our bruddas found da wey toda queen.";
const CScript genesisOutputScript = CScript() << ParseHex("04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f") << OP_CHECKSIG;
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
*/
const arith_uint256 maxUint = UintToArith256(uint256S("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"));
class CMainParams : public CChainParams {
public:
CMainParams() {
strNetworkID = "main";
consensus.nSubsidyHalvingInterval = 200000;
consensus.BIP34Height = 1;
consensus.BIP34Hash = uint256S("00000e173190d0d57bf3167bf7d42458be29cbe043960234482486b709188f64");
consensus.BIP65Height = 0;
consensus.BIP66Height = 0;
consensus.BIP102HeightDelta = 0;
consensus.powLimit = uint256S("00000fffff000000000000000000000000000000000000000000000000000000");
consensus.nPowAveragingWindow = 8;
assert(maxUint/UintToArith256(consensus.powLimit) >= consensus.nPowAveragingWindow);
consensus.nPowMaxAdjustDown = 31; // Zawy adjustment: (1 - 1/0.765)x100 (0.765 = v1b)
consensus.nPowMaxAdjustUp = 23.7; // Zawy adjustment: 1- 1/(1+.31)x100 = 23.7
consensus.nPowTargetTimespan = 5 * 60; //5 minutes
consensus.nPowTargetSpacing = 20; //20 seconds
consensus.fPowD106SwitchHeight = consensus.DifficultyAdjustmentInterval();
consensus.fPowAllowMinDifficultyBlocks = false;
consensus.fPowAllowDigishieldMinDifficultyBlocks = false;
consensus.fPowAllowMinDifficultyBlocks = false;
consensus.fPowNoRetargeting = false;
consensus.nRuleChangeActivationThreshold = 9576;
consensus.nMinerConfirmationWindow = 10080;
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28;
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 1199145601;
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = 1716483599;
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nOverrideMinerConfirmationWindow = 1;
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nOverrideRuleChangeActivationThreshold = 1;
// Deployment of BIP68, BIP112, and BIP113.
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].bit = 0;
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nStartTime = 1462060800;
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nTimeout = 1716483599;
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nOverrideMinerConfirmationWindow = 1;
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nOverrideRuleChangeActivationThreshold = 1;
// Deployment of SegWit (BIP141, BIP143, and BIP147)
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].bit = 1;
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nStartTime = 1496275200;
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nTimeout = 1716483599;
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nOverrideMinerConfirmationWindow = 1;
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nOverrideRuleChangeActivationThreshold = 1;
// Deployment of SegWit2x
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT2X].bit = 4;
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT2X].nStartTime = 1496275200;
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT2X].nTimeout = 1716483599;
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT2X].nOverrideMinerConfirmationWindow = 1;
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT2X].nOverrideRuleChangeActivationThreshold = 1;
// The best chain should have at least this much work.
consensus.nMinimumChainWork = uint256S("0x000000000000000000000000000000000000000000000000006cd4228b3c2bbd");
consensus.defaultAssumeValid = uint256S("0x0");
//5 weeks from launch, fair chance to buy/accumulate. 75000 blocks
consensus.MasternodePaymentStartHeight = 75000;
consensus.mpaStartHeight = 127150;
//
/**
* 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] = 0xda;
pchMessageStart[1] = 0x8e;
pchMessageStart[2] = 0xf1;
pchMessageStart[3] = 0x2d;
nDefaultPort = 11526;
nPruneAfterHeight = 100000;
genesis = CreateGenesisBlock(1516483599, 416520, 0x1e0ffff0, 1, 50 * COIN);
consensus.hashGenesisBlock = genesis.GetHash();
assert(consensus.hashGenesisBlock == uint256S("0x000006ed0805a3f7db7c1430e73d52bdc1c3bbc278f3534117d8a0e4c86b88a5"));
assert(genesis.hashMerkleRoot == uint256S("0x1c414ca84fe73ee0a6fe5b07c8c129026e424baeb285fc81ddb019cfa67a7f0c"));
// Clear out seeds for hardfork
vSeeds.push_back(CDNSSeedData("seed.weycoin.org", "seed.weycoin.org"));
vSeeds.push_back(CDNSSeedData("seed2.weycoin.org", "seed2.weycoin.org"));
vSeeds.push_back(CDNSSeedData("seed3.weycoin.org", "seed3.weycoin.org"));
vSeeds.push_back(CDNSSeedData("seed4.weycoin.org", "seed4.weycoin.org"));
vSeeds.push_back(CDNSSeedData("seed5.weycoin.org", "seed5.weycoin.org"));
vSeeds.push_back(CDNSSeedData("seed6.weycoin.org", "seed6.weycoin.org"));
vSeeds.push_back(CDNSSeedData("seed7.weycoin.org", "seed7.weycoin.org"));
vSeeds.push_back(CDNSSeedData("seed8.weycoin.org", "seed8.weycoin.org"));
vSeeds.push_back(CDNSSeedData("seed9.weycoin.org", "seed9.weycoin.org"));
vSeeds.push_back(CDNSSeedData("seed10.weycoin.org", "seed10.weycoin.org"));
vSeeds.push_back(CDNSSeedData("seed11.weycoin.org", "seed11.weycoin.org"));
vSeeds.push_back(CDNSSeedData("seed12.weycoin.org", "seed12.weycoin.org"));
vSeeds.push_back(CDNSSeedData("seed13.weycoin.org", "seed13.weycoin.org"));
vSeeds.push_back(CDNSSeedData("seed14.weycoin.org", "seed14.weycoin.org"));
vSeeds.push_back(CDNSSeedData("seed15.weycoin.org", "seed15.weycoin.org"));
vSeeds.push_back(CDNSSeedData("seed16.weycoin.org", "seed16.weycoin.org"));
vSeeds.push_back(CDNSSeedData("seed17.weycoin.org", "seed17.weycoin.org"));
vSeeds.push_back(CDNSSeedData("seed18.weycoin.org", "seed18.weycoin.org"));
vSeeds.push_back(CDNSSeedData("seed19.weycoin.org", "seed19.weycoin.org"));
vSeeds.push_back(CDNSSeedData("seed20.weycoin.org", "seed20.weycoin.org"));
base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,46);
base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,5);
base58Prefixes[SCRIPT_ADDRESS2] = std::vector<unsigned char>(1,50);
base58Prefixes[SECRET_KEY] = std::vector<unsigned char>(1,204);
base58Prefixes[EXT_PUBLIC_KEY] = boost::assign::list_of(0x04)(0x88)(0xB2)(0x1E).convert_to_container<std::vector<unsigned char> >();
base58Prefixes[EXT_SECRET_KEY] = boost::assign::list_of(0x04)(0x88)(0xAD)(0xE4).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 = false;
checkpointData = (CCheckpointData) {
{
{ 0, uint256S("0x000006ed0805a3f7db7c1430e73d52bdc1c3bbc278f3534117d8a0e4c86b88a5")},
{ 256, uint256S("0x00000000a334c739f1ae1f23f7d996fe6c95b247dc8de83cf92ae73f110d5317")},
{ 12500, uint256S("0x0000000003f5ad275187245b3c0eb1ffe5cfb26109d0939f1fade2c2f5c219fe")},
{ 16000, uint256S("0x0000000011120f00c57a0df89cd2d3dc05b61f52243ab27d0a83b4acae2221ce")},
{ 55000, uint256S("0x000000007647c73e8731967b37a8e71358daeb16084a18781238a5b7e7483d16")},
{ 71000, uint256S("0x000000000023c3537a29870ee5f64ca12fa60207732010dccc7a5283992c6259")},
{ 82475, uint256S("0x00000000061523e6bc640284601307001ee74505399c4470bd943339c2157c05")},
{ 110000, uint256S("0x0000000011e05c495f94dc2a42df1448bdf9748bdc3410730b70026ce7d5ce03")},
{ 127150, uint256S("0x00000000099a151ec7e1b88be6b5ab2dea4da7a0d919e999e5d0eb31f207d996")},
{ 127875, uint256S("0x0000000007417c8999a996c5c0c3b6429ad93468dfcc44f56bf90036d542a792")},
{ 150000, uint256S("0x000000000166e5747033e3680080c8954f4513a3257dfdc3d2e231c974794407")},
{ 188340, uint256S("0x0000000005c13e1e9d00d4aaa750e885b78d55d7a634981ba6691d55d5e0e5d2")},
{ 190495, uint256S("0x0000000000e007b682f5ed54e8a96f0f36afca51d83c792eaa0440b0a0d93ce2")},
{ 244000, uint256S("0x0000000004cbb787c630b87ce651f889ee78b930f0ece1ddb95ef26a239dced2")}
}
};
// treasury payment adresses
vTreasuryRewardAddress = {
"3K3bPrW5h7DYEMp2RcXawTCXajcm4ZU9Zh",
"33Ssxmn3ehVMgyxgegXhpLGSBpubPjLZQ6",
"3HFPNAjesiBY5sSVUmuBFnMEGut69R49ca",
"37jLjjfUXQU4bdqVzvpUXyzAqPQSmxyByi"
};
// [1] UNIX timestamp of last known number of transactions
// [2] total number of transactions between genesis and that timestamp
// (the tx=... number in the SetBestChain debug.log lines)
// [3] estimated number of transactions per second after that timestamp
chainTxData = ChainTxData {
1523137215,
276485,
1.1
};
}
};
static CMainParams mainParams;
/**
* Testnet (v3)
*/
class CTestNetParams : public CChainParams {
public:
CTestNetParams() {
strNetworkID = "test";
consensus.BIP34Height = 1;
consensus.BIP34Hash = uint256S("0x0");
consensus.BIP65Height = 0; // 00000000007f6655f22f98e72ed80d8b06dc761d5da09df0fa1dc4be4f861eb6
consensus.BIP66Height = 0; // 000000002104c8c45e99a8853285a3b592602a3ccde2b832481da85e9e4ba182
consensus.BIP102HeightDelta = 0;
consensus.powLimit = uint256S("00000fffff000000000000000000000000000000000000000000000000000000");
consensus.nPowAveragingWindow = 8;
assert(maxUint/UintToArith256(consensus.powLimit) >= consensus.nPowAveragingWindow);
consensus.nPowMaxAdjustDown = 31; // Zawy adjustment: (1 - 1/0.765)x100 (0.765 = v1b)
consensus.nPowMaxAdjustUp = 23.7; // Zawy adjustment: 1- 1/(1+.31)x100 = 23.7
consensus.nPowTargetTimespan = 1 * 60; //1 minutes
consensus.nPowTargetSpacing = 10; //seconds
consensus.fPowD106SwitchHeight = 30;
consensus.fDigishieldDifficultyCalculation = false;
consensus.fPowAllowMinDifficultyBlocks = true;
consensus.fPowAllowDigishieldMinDifficultyBlocks = true;
consensus.fPowNoRetargeting = false;
consensus.nRuleChangeActivationThreshold = 6480;
consensus.nMinerConfirmationWindow = 8640; //1 day
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28;
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 1199145601;
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = 1514764800;
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nOverrideMinerConfirmationWindow = 1;
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nOverrideRuleChangeActivationThreshold = 1;
// Deployment of BIP68, BIP112, and BIP113.
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].bit = 0;
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nStartTime = 1462060800;
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nTimeout = 1514764800;
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nOverrideMinerConfirmationWindow = 1;
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nOverrideRuleChangeActivationThreshold = 1;
// Deployment of SegWit (BIP141, BIP143, and BIP147)
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].bit = 1;
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nStartTime = 1496275200;
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nTimeout = 1514764800;
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nOverrideMinerConfirmationWindow = 1;
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nOverrideRuleChangeActivationThreshold = 1;
// Deployment of SegWit2x
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT2X].bit = 4;
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT2X].nStartTime = 1496275200;
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT2X].nTimeout = 1514764800;
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT2X].nOverrideMinerConfirmationWindow = 1;
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT2X].nOverrideRuleChangeActivationThreshold = 1;
// The best chain should have at least this much work.
consensus.nMinimumChainWork = uint256S("000000000000000000000000000000000000000000000000000000539862b0de");
// By default assume that the signatures in ancestors of this block are valid.
consensus.defaultAssumeValid = uint256S("0x0");
consensus.MasternodePaymentStartHeight = 1440;
consensus.mpaStartHeight = 1500;
pchMessageStart[0] = 0x2a;
pchMessageStart[1] = 0x1e;
pchMessageStart[2] = 0xd5;
pchMessageStart[3] = 0xd1;
nDefaultPort = 10526;
nPruneAfterHeight = 1000;
genesis = CreateGenesisBlock(1520531492, 493300, 0x1e0ffff0, 1, 120 * COIN);//Time, Nonce,nBits, version, reward
consensus.hashGenesisBlock = genesis.GetHash();
/*
Testnet Genesis Merkle Root: ea276c333d904af5bfb6ea126418719604211c95567475a32f2d38bcc8fd9552
New testnet genesis nonce 493300
New testnet genesis hash: 00000ea86500f42394a938cecb035cdd6f58aec2680484211417d23ec18bb76e
printf("Starting Genesis Block Mining\n");
genesis.nNonce = 0;
consensus.hashGenesisBlock = uint256S("0x001");
for (genesis.nNonce == 0; UintToArith256(genesis.GetHash()) > UintToArith256(consensus.powLimit); genesis.nNonce++) {}
printf("Testnet Genesis Merkle Root: %s\n", genesis.hashMerkleRoot.ToString().c_str());
printf("New testnet genesis nonce %d\n", genesis.nNonce);
printf("New testnet genesis hash: %s\n", genesis.GetHash().ToString().c_str());*/
assert(consensus.hashGenesisBlock == uint256S("0x00000ea86500f42394a938cecb035cdd6f58aec2680484211417d23ec18bb76e"));
assert(genesis.hashMerkleRoot == uint256S("0xea276c333d904af5bfb6ea126418719604211c95567475a32f2d38bcc8fd9552"));
vSeeds.clear();
base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,46);
base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,19);
base58Prefixes[SECRET_KEY] = std::vector<unsigned char>(1,239);
base58Prefixes[EXT_PUBLIC_KEY] = boost::assign::list_of(0xA2)(0xAE)(0xC9)(0xA6).convert_to_container<std::vector<unsigned char> >();
base58Prefixes[EXT_SECRET_KEY] = boost::assign::list_of(0x46)(0x00)(0x2A)(0x10).convert_to_container<std::vector<unsigned char> >();
vFixedSeeds = std::vector<SeedSpec6>(pnSeed6_test, pnSeed6_test + ARRAYLEN(pnSeed6_test));
fMiningRequiresPeers = false;
fDefaultConsistencyChecks = false;
fRequireStandard = false;
fMineBlocksOnDemand = false;
checkpointData = (CCheckpointData) {
{
{ 0, uint256S("0x00000ea86500f42394a938cecb035cdd6f58aec2680484211417d23ec18bb76e")}
}
};
vTreasuryRewardAddress = {
"0"
};
chainTxData = ChainTxData{
0,
0,
0
};
}
};
static CTestNetParams testNetParams;
/**
* Regression test
*/
class CRegTestParams : public CChainParams {
public:
CRegTestParams() {
strNetworkID = "regtest";
consensus.BIP34Height = 0;
consensus.BIP34Hash = uint256S("000002db0642636c786f756062dd7a92f35a2be1665816f8bfa33111ae902b37");
consensus.BIP65Height = 0;
consensus.BIP66Height = 0;
consensus.powLimit = uint256S("00000fffff000000000000000000000000000000000000000000000000000000");
consensus.BIP102HeightDelta = 0;
consensus.nPowAveragingWindow = 8;
assert(maxUint/UintToArith256(consensus.powLimit) >= consensus.nPowAveragingWindow);
consensus.nPowMaxAdjustDown = 31; // Zawy adjustment: (1 - 1/0.765)x100 (0.765 = v1b)
consensus.nPowMaxAdjustUp = 23.7; // Zawy adjustment: 1- 1/(1+.31)x100 = 23.7
consensus.nPowTargetTimespan = 60; //1 minute
consensus.nPowTargetSpacing = 1; //1 second
consensus.fPowD106SwitchHeight = 30;
consensus.fDigishieldDifficultyCalculation = false;
consensus.fPowAllowMinDifficultyBlocks = true;
consensus.fPowAllowDigishieldMinDifficultyBlocks = true;
consensus.fPowNoRetargeting = true;
consensus.nRuleChangeActivationThreshold = 5400;
consensus.nMinerConfirmationWindow = 7200;
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28;
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 1199145601;
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = 1514764800;
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nOverrideMinerConfirmationWindow = 1;
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nOverrideRuleChangeActivationThreshold = 1;
// Deployment of BIP68, BIP112, and BIP113.
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].bit = 0;
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nStartTime = 1462060800;
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nTimeout = 1514764800;
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nOverrideMinerConfirmationWindow = 1;
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nOverrideRuleChangeActivationThreshold = 1;
// Deployment of SegWit (BIP141, BIP143, and BIP147)
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].bit = 1;
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nStartTime = 1496275200;
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nTimeout = 1514764800;
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nOverrideMinerConfirmationWindow = 1;
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nOverrideRuleChangeActivationThreshold = 1;
// Deployment of SegWit2x
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT2X].bit = 4;
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT2X].nStartTime = 1496275200;
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT2X].nTimeout = 1514764800;
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT2X].nOverrideMinerConfirmationWindow = 1;
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT2X].nOverrideRuleChangeActivationThreshold = 1;
// The best chain should have at least this much work.
consensus.nMinimumChainWork = uint256S("0x0");
// By default assume that the signatures in ancestors of this block are valid.
consensus.defaultAssumeValid = uint256S("0x0");
consensus.MasternodePaymentStartHeight = 1440;
pchMessageStart[0] = 0x6e;
pchMessageStart[1] = 0x5c;
pchMessageStart[2] = 0x2c;
pchMessageStart[3] = 0xef;
nDefaultPort = 7505;
nPruneAfterHeight = 1000;
genesis = CreateGenesisBlock(1510791654, 1079442, 0x1e0ffff0, 1, 10 * COIN);//Time, Nonce,nBits, version, reward
consensus.hashGenesisBlock = genesis.GetHash();
/*
CreateGenesisBlock(1510272549, 1547336, 0x1e0ffff0, 1, 10 * COIN)
NEW **regtest** genesis nonce: 1079442
NEW **regtest** genesis hash: 000002db0642636c786f756062dd7a92f35a2be1665816f8bfa33111ae902b37
NEW **regtest** merkle root: 15343d9e3cfff44854ec63cc588d5a1ed6ea971085c2be97acb0ea22c0e94fc4
*/
assert(consensus.hashGenesisBlock == uint256S("000002db0642636c786f756062dd7a92f35a2be1665816f8bfa33111ae902b37"));
assert(genesis.hashMerkleRoot == uint256S("15343d9e3cfff44854ec63cc588d5a1ed6ea971085c2be97acb0ea22c0e94fc4"));
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;
checkpointData = (CCheckpointData) {
boost::assign::map_list_of
( 0, uint256S("000002db0642636c786f756062dd7a92f35a2be1665816f8bfa33111ae902b37") )
};
vTreasuryRewardAddress = {
"2N6TJncxtMLSqEurFaEGtpLxdvq5wiVcR6S"
};
chainTxData = ChainTxData{
0,
0,
0
};
base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,122);
base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,196);
base58Prefixes[SECRET_KEY] = std::vector<unsigned char>(1,239);
base58Prefixes[EXT_PUBLIC_KEY] = boost::assign::list_of(0xA2)(0xAE)(0xC9)(0xA6).convert_to_container<std::vector<unsigned char> >();
base58Prefixes[EXT_SECRET_KEY] = boost::assign::list_of(0x46)(0x00)(0x2A)(0x10).convert_to_container<std::vector<unsigned char> >();
}
void UpdateBIP9Parameters(Consensus::DeploymentPos d, int64_t nStartTime, int64_t nTimeout)
{
consensus.vDeployments[d].nStartTime = nStartTime;
consensus.vDeployments[d].nTimeout = nTimeout;
}
};
//static CRegTestParams regTestParams;
static CChainParams *pCurrentParams = 0;
const CChainParams &Params() {
assert(pCurrentParams);
return *pCurrentParams;
}
CChainParams& Params(const std::string& chain)
{
return mainParams;
}
void SelectParams(const std::string& network)
{
SelectBaseParams(network);
pCurrentParams = &Params(network);
}
void UpdateRegtestBIP9Parameters(Consensus::DeploymentPos d, int64_t nStartTime, int64_t nTimeout)
{
//regTestParams.UpdateBIP9Parameters(d, nStartTime, nTimeout);
}
std::string CChainParams::GetTreasuryRewardAddressAtHeight(int nHeight) const {
size_t i = nHeight % vTreasuryRewardAddress.size();
return vTreasuryRewardAddress[i];
}
CScript CChainParams::GetTreasuryRewardScriptAtHeight(int nHeight) const {
CWeyCoinAddress address(GetTreasuryRewardAddressAtHeight(nHeight).c_str());
printf("Searching for blocks.");
assert(address.IsValid());
assert(address.IsScript());
CScriptID scriptID = boost::get<CScriptID>(address.Get()); // Get() returns a boost variant
CScript script = CScript() << OP_HASH160 << ToByteVector(scriptID) << OP_EQUAL;
return script;
}
std::string CChainParams::GetTreasuryRewardAddressAtIndex(int i) const {
assert(i >= 0 && i < vTreasuryRewardAddress.size());
return vTreasuryRewardAddress[i];
}