- 397FA4CAF80112EF2A0EF2905AB0AF4DF49E437B926E5DDE97167D888423A21E5B34F42361296BC065D31F49A8BDA21AEDFC6365684BC9CADD873598803B912C+ F58C522EF8E2A659BB35FD9607E6F4F97BC8D1D2CCDC543A6B3FB1F834D15258C73899EA7442EE3F0382E6F50AAC6A44656446F1548EAF01E7ADF1A7959924BAbitcoin/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);