|回复： 曾节明 转Kai的话，你是不懂装懂， 2017-04-01 00:05:16 [Reads:94]|
|作者： java 2017-04-01 00:17:59 [Reads:142]  ||返回共舞台首页|
Upon startup, if peer node discovery is needed, the client then issues DNS requests to learn about the addresses of other peer nodes. The client includes a list of host names for DNS services that are seeded. As-of May 17, 2012 the list (from chainparams.cpp) includes:
A DNS reply can contain multiple IP addresses for a requested name.
Addresses discovered via DNS are initially given a zero timestamp, therefore they are not advertised in response to a "getaddr" request.
Hard Coded "Seed" Addresses
The client contains hard coded IP addresses that represent bitcoin nodes.
These addresses are only used as a last resort, if no other method has produced any addresses at all. When the loop in the connection handling thread ThreadOpenConnections2() sees an empty address map, it uses the "seed" IP addresses as backup.
There is code is move away from seed nodes when possible. The presumption is that this is to avoid overloading those nodes. Once the local node has enough addresses (presumably learned from the seed nodes), the connection thread will close seed node connections.
Seed Addresses are initially given a zero timestamp, therefore they are not advertised in response to a "getaddr" request.