cmd/devp2p: adapt to new iterator interface

This commit is contained in:
Felix Lange 2019-07-09 13:50:39 +02:00
parent 3498a73ec8
commit 270adea13b

View file

@ -17,7 +17,6 @@
package main
import (
"context"
"fmt"
"net"
"sort"
@ -123,14 +122,11 @@ func discv4RandomNodes(ctx *cli.Context) error {
}
defer disc.Close()
iter := disc.RandomNodes()
for {
n, ok := iter.NextNode(context.Background())
if !ok {
return nil
}
fmt.Println(n)
it := disc.RandomNodes()
for it.Next() {
fmt.Println(it.Node())
}
return nil
}
func getNodeArgAndStartV4(ctx *cli.Context) (*enode.Node, *discover.UDPv4, error) {