- C67FDD55E9D9D6B4973122B76729D7E83A456A8DC410F1C130CFFBFD9F626C47CA7E8006BDE912D9E0BD0A4B8457E895270D4A0EFD22C4A199CD52FFD95B10DD
+ 3EF738258288E826FA190F599E0DD1B655C6D90C17D97454FCB95324471F5098F692631AC552D6BF1F10D802DB237DE94952D91F426878FC85D03B78E073A45F
bitcoin/src/net.cpp
(19 . 7)(19 . 6)
24 void ThreadMessageHandler2(void* parg);
25 void ThreadSocketHandler2(void* parg);
26 void ThreadOpenConnections2(void* parg);
27 void ThreadDNSAddressSeed2(void* parg);
28 bool OpenNetworkConnection(const CAddress& addrConnect);
29
30
(1067 . 92)(1066 . 6)
32 }
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 static const char *strDNSSeed[] = {
53 "bitseed.xf2.org",
54 "dnsseed.bluematt.me",
55 "seed.bitcoin.sipa.be",
56 "dnsseed.bitcoin.dashjr.org",
57 };
58
59 void ThreadDNSAddressSeed(void* parg)
60 {
61 IMPLEMENT_RANDOMIZE_STACK(ThreadDNSAddressSeed(parg));
62 try
63 {
64 vnThreadsRunning[6]++;
65 ThreadDNSAddressSeed2(parg);
66 vnThreadsRunning[6]--;
67 }
68 catch (std::exception& e) {
69 vnThreadsRunning[6]--;
70 PrintException(&e, "ThreadDNSAddressSeed()");
71 } catch (...) {
72 vnThreadsRunning[6]--;
73 throw; // support pthread_cancel()
74 }
75 printf("ThreadDNSAddressSeed exiting\n");
76 }
77
78 void ThreadDNSAddressSeed2(void* parg)
79 {
80 printf("ThreadDNSAddressSeed started\n");
81 int found = 0;
82
83 if (!fTestNet)
84 {
85 printf("Loading addresses from DNS seeds (could take a while)\n");
86
87 for (int seed_idx = 0; seed_idx < ARRAYLEN(strDNSSeed); seed_idx++) {
88 vector<CAddress> vaddr;
89 if (Lookup(strDNSSeed[seed_idx], vaddr, NODE_NETWORK, -1, true))
90 {
91 CAddrDB addrDB;
92 addrDB.TxnBegin();
93 BOOST_FOREACH (CAddress& addr, vaddr)
94 {
95 if (addr.GetByte(3) != 127)
96 {
97 addr.nTime = 0;
98 AddAddress(addr, 0, &addrDB);
99 found++;
100 }
101 }
102 addrDB.TxnCommit(); // Save addresses (it's ok if this fails)
103 }
104 }
105 }
106
107 printf("%d addresses found from DNS seeds\n", found);
108 }
109
110
111
112
113
114
115
116
117
118
119
120
121 unsigned int pnSeed[] =
122 {
123 0x959bd347, 0xf8de42b2, 0x73bc0518, 0xea6edc50, 0x21b00a4d, 0xc725b43d, 0xd665464d, 0x1a2a770e,
(1649 . 12)(1562 . 6)
125 // Start threads
126 //
127
128 if (GetBoolArg("-nodnsseed"))
129 printf("DNS seeding disabled\n");
130 else
131 if (!CreateThread(ThreadDNSAddressSeed, NULL))
132 printf("Error: CreateThread(ThreadDNSAddressSeed) failed\n");
133
134 // Get addresses from IRC and advertise ours
135 if (!CreateThread(ThreadIRCSeed, NULL))
136 printf("Error: CreateThread(ThreadIRCSeed) failed\n");
(1693 . 7)(1600 . 6)
138 if (vnThreadsRunning[2] > 0) printf("ThreadMessageHandler still running\n");
139 if (vnThreadsRunning[3] > 0) printf("ThreadBitcoinMiner still running\n");
140 if (vnThreadsRunning[4] > 0) printf("ThreadRPCServer still running\n");
141 if (vnThreadsRunning[6] > 0) printf("ThreadDNSAddressSeed still running\n");
142 while (vnThreadsRunning[2] > 0 || vnThreadsRunning[4] > 0)
143 Sleep(20);
144 Sleep(50);