mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
p2p: adapt to new iterator interface
This commit is contained in:
parent
1fa2bf9e4e
commit
3498a73ec8
1 changed files with 2 additions and 5 deletions
|
|
@ -17,7 +17,6 @@
|
||||||
package p2p
|
package p2p
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net"
|
"net"
|
||||||
|
|
@ -327,13 +326,11 @@ type discoverTask struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *discoverTask) Do(srv *Server) {
|
func (t *discoverTask) Do(srv *Server) {
|
||||||
ctx, cancel := context.WithTimeout(context.Background(), discoveryTimeout)
|
t.results = discutil.ReadNodes(srv.discmix, t.want)
|
||||||
defer cancel()
|
|
||||||
t.results = discutil.ReadNodes(ctx, srv.discmix, t.want)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *discoverTask) String() string {
|
func (t *discoverTask) String() string {
|
||||||
s := "discovery lookup"
|
s := "discovery query"
|
||||||
if len(t.results) > 0 {
|
if len(t.results) > 0 {
|
||||||
s += fmt.Sprintf(" (%d results)", len(t.results))
|
s += fmt.Sprintf(" (%d results)", len(t.results))
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue