les: fix nodiscover option (#21906)

This commit is contained in:
Felföldi Zsolt
2020-12-01 10:03:41 +01:00
committed by GitHub
parent e7db1dbc96
commit a2795c8055
5 changed files with 9 additions and 9 deletions

View File

@ -19,7 +19,6 @@ package eth
import (
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/forkid"
"github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/p2p/dnsdisc"
"github.com/ethereum/go-ethereum/p2p/enode"
"github.com/ethereum/go-ethereum/rlp"
@ -65,8 +64,8 @@ func (eth *Ethereum) currentEthEntry() *ethEntry {
}
// setupDiscovery creates the node discovery source for the eth protocol.
func (eth *Ethereum) setupDiscovery(cfg *p2p.Config) (enode.Iterator, error) {
if cfg.NoDiscovery || len(eth.config.DiscoveryURLs) == 0 {
func (eth *Ethereum) setupDiscovery() (enode.Iterator, error) {
if len(eth.config.DiscoveryURLs) == 0 {
return nil, nil
}
client := dnsdisc.NewClient(dnsdisc.Config{})