|
5 | 5 |
|
6 | 6 | #include "chainparams.h"
|
7 | 7 |
|
8 |
| -#include "random.h" |
9 | 8 | #include "util.h"
|
10 | 9 | #include "utilstrencodings.h"
|
11 | 10 |
|
|
15 | 14 |
|
16 | 15 | using namespace std;
|
17 | 16 |
|
18 |
| -struct SeedSpec6 { |
19 |
| - uint8_t addr[16]; |
20 |
| - uint16_t port; |
21 |
| -}; |
22 |
| - |
23 | 17 | #include "chainparamsseeds.h"
|
24 | 18 |
|
25 | 19 | /**
|
26 | 20 | * Main network
|
27 | 21 | */
|
28 |
| - |
29 |
| -//! Convert the pnSeeds6 array into usable address objects. |
30 |
| -static void convertSeed6(std::vector<CAddress> &vSeedsOut, const SeedSpec6 *data, unsigned int count) |
31 |
| -{ |
32 |
| - // It'll only connect to one or two seed nodes because once it connects, |
33 |
| - // it'll get a pile of addresses with newer timestamps. |
34 |
| - // Seed nodes are given a random 'last seen time' of between one and two |
35 |
| - // weeks ago. |
36 |
| - const int64_t nOneWeek = 7*24*60*60; |
37 |
| - for (unsigned int i = 0; i < count; i++) |
38 |
| - { |
39 |
| - struct in6_addr ip; |
40 |
| - memcpy(&ip, data[i].addr, sizeof(ip)); |
41 |
| - CAddress addr(CService(ip, data[i].port)); |
42 |
| - addr.nTime = GetTime() - GetRand(nOneWeek) - nOneWeek; |
43 |
| - vSeedsOut.push_back(addr); |
44 |
| - } |
45 |
| -} |
46 |
| - |
47 | 22 | /**
|
48 | 23 | * What makes a good checkpoint block?
|
49 | 24 | * + Is surrounded by blocks with reasonable timestamps
|
@@ -164,7 +139,7 @@ class CMainParams : public CChainParams {
|
164 | 139 | base58Prefixes[EXT_PUBLIC_KEY] = boost::assign::list_of(0x04)(0x88)(0xB2)(0x1E).convert_to_container<std::vector<unsigned char> >();
|
165 | 140 | base58Prefixes[EXT_SECRET_KEY] = boost::assign::list_of(0x04)(0x88)(0xAD)(0xE4).convert_to_container<std::vector<unsigned char> >();
|
166 | 141 |
|
167 |
| - convertSeed6(vFixedSeeds, pnSeed6_main, ARRAYLEN(pnSeed6_main)); |
| 142 | + vFixedSeeds = std::vector<SeedSpec6>(pnSeed6_main, pnSeed6_main + ARRAYLEN(pnSeed6_main)); |
168 | 143 |
|
169 | 144 | fRequireRPCPassword = true;
|
170 | 145 | fMiningRequiresPeers = true;
|
@@ -220,7 +195,7 @@ class CTestNetParams : public CMainParams {
|
220 | 195 | base58Prefixes[EXT_PUBLIC_KEY] = boost::assign::list_of(0x04)(0x35)(0x87)(0xCF).convert_to_container<std::vector<unsigned char> >();
|
221 | 196 | base58Prefixes[EXT_SECRET_KEY] = boost::assign::list_of(0x04)(0x35)(0x83)(0x94).convert_to_container<std::vector<unsigned char> >();
|
222 | 197 |
|
223 |
| - convertSeed6(vFixedSeeds, pnSeed6_test, ARRAYLEN(pnSeed6_test)); |
| 198 | + vFixedSeeds = std::vector<SeedSpec6>(pnSeed6_test, pnSeed6_test + ARRAYLEN(pnSeed6_test)); |
224 | 199 |
|
225 | 200 | fRequireRPCPassword = true;
|
226 | 201 | fMiningRequiresPeers = true;
|
|
0 commit comments