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

@ -17,7 +17,6 @@
package les
import (
"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"
@ -35,8 +34,8 @@ func (e lesEntry) ENRKey() string {
}
// setupDiscovery creates the node discovery source for the eth protocol.
func (eth *LightEthereum) setupDiscovery(cfg *p2p.Config) (enode.Iterator, error) {
if cfg.NoDiscovery || len(eth.config.DiscoveryURLs) == 0 {
func (eth *LightEthereum) setupDiscovery() (enode.Iterator, error) {
if len(eth.config.DiscoveryURLs) == 0 {
return nil, nil
}
client := dnsdisc.NewClient(dnsdisc.Config{})