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
|
||||
|
||||
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 {
|
||||
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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue