mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
cmd/devp2p: adapt to new iterator interface
This commit is contained in:
parent
3498a73ec8
commit
270adea13b
1 changed files with 4 additions and 8 deletions
|
|
@ -17,7 +17,6 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"net"
|
"net"
|
||||||
"sort"
|
"sort"
|
||||||
|
|
@ -123,15 +122,12 @@ func discv4RandomNodes(ctx *cli.Context) error {
|
||||||
}
|
}
|
||||||
defer disc.Close()
|
defer disc.Close()
|
||||||
|
|
||||||
iter := disc.RandomNodes()
|
it := disc.RandomNodes()
|
||||||
for {
|
for it.Next() {
|
||||||
n, ok := iter.NextNode(context.Background())
|
fmt.Println(it.Node())
|
||||||
if !ok {
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
fmt.Println(n)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func getNodeArgAndStartV4(ctx *cli.Context) (*enode.Node, *discover.UDPv4, error) {
|
func getNodeArgAndStartV4(ctx *cli.Context) (*enode.Node, *discover.UDPv4, error) {
|
||||||
if ctx.NArg() != 1 {
|
if ctx.NArg() != 1 {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue