mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
eth: add comments
This commit is contained in:
parent
f24e8e7109
commit
59f9ff5b32
1 changed files with 3 additions and 0 deletions
|
|
@ -373,6 +373,7 @@ func (s *Ethereum) Start() error {
|
||||||
func (s *Ethereum) setupDiscovery() error {
|
func (s *Ethereum) setupDiscovery() error {
|
||||||
eth.StartENRUpdater(s.blockchain, s.p2pServer.LocalNode())
|
eth.StartENRUpdater(s.blockchain, s.p2pServer.LocalNode())
|
||||||
|
|
||||||
|
// Add eth nodes from DNS.
|
||||||
dnsclient := dnsdisc.NewClient(dnsdisc.Config{})
|
dnsclient := dnsdisc.NewClient(dnsdisc.Config{})
|
||||||
if len(s.config.EthDiscoveryURLs) > 0 {
|
if len(s.config.EthDiscoveryURLs) > 0 {
|
||||||
iter, err := dnsclient.NewIterator(s.config.EthDiscoveryURLs...)
|
iter, err := dnsclient.NewIterator(s.config.EthDiscoveryURLs...)
|
||||||
|
|
@ -382,6 +383,7 @@ func (s *Ethereum) setupDiscovery() error {
|
||||||
s.discmix.AddSource(iter)
|
s.discmix.AddSource(iter)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add snap nodes from DNS.
|
||||||
if len(s.config.SnapDiscoveryURLs) > 0 {
|
if len(s.config.SnapDiscoveryURLs) > 0 {
|
||||||
iter, err := dnsclient.NewIterator(s.config.SnapDiscoveryURLs...)
|
iter, err := dnsclient.NewIterator(s.config.SnapDiscoveryURLs...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -390,6 +392,7 @@ func (s *Ethereum) setupDiscovery() error {
|
||||||
s.discmix.AddSource(iter)
|
s.discmix.AddSource(iter)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add DHT nodes from discv5.
|
||||||
if s.p2pServer.DiscoveryV5() != nil {
|
if s.p2pServer.DiscoveryV5() != nil {
|
||||||
filter := eth.NewNodeFilter(s.blockchain)
|
filter := eth.NewNodeFilter(s.blockchain)
|
||||||
iter := enode.Filter(s.p2pServer.DiscoveryV5().RandomNodes(), filter)
|
iter := enode.Filter(s.p2pServer.DiscoveryV5().RandomNodes(), filter)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue