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,15 +122,12 @@ func discv4RandomNodes(ctx *cli.Context) error {
}
defer disc.Close()
iter := disc.RandomNodes()
for {
n, ok := iter.NextNode(context.Background())
if !ok {
it := disc.RandomNodes()
for it.Next() {
fmt.Println(it.Node())
}
return nil
}
fmt.Println(n)
}
}
func getNodeArgAndStartV4(ctx *cli.Context) (*enode.Node, *discover.UDPv4, error) {
if ctx.NArg() != 1 {