core, eth: split eth package, implement snap protocol (#21482)
This commit splits the eth package, separating the handling of eth and snap protocols. It also includes the capability to run snap sync (https://github.com/ethereum/devp2p/blob/master/caps/snap.md) , but does not enable it by default. Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de> Co-authored-by: Martin Holst Swende <martin@swende.se>
This commit is contained in:
@ -63,11 +63,12 @@ func (eth *Ethereum) currentEthEntry() *ethEntry {
|
||||
eth.blockchain.CurrentHeader().Number.Uint64())}
|
||||
}
|
||||
|
||||
// setupDiscovery creates the node discovery source for the eth protocol.
|
||||
func (eth *Ethereum) setupDiscovery() (enode.Iterator, error) {
|
||||
if len(eth.config.DiscoveryURLs) == 0 {
|
||||
// setupDiscovery creates the node discovery source for the `eth` and `snap`
|
||||
// protocols.
|
||||
func setupDiscovery(urls []string) (enode.Iterator, error) {
|
||||
if len(urls) == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
client := dnsdisc.NewClient(dnsdisc.Config{})
|
||||
return client.NewIterator(eth.config.DiscoveryURLs...)
|
||||
return client.NewIterator(urls...)
|
||||
}
|
||||
|
Reference in New Issue
Block a user