p2p/discover: fix lookup failure log

This commit is contained in:
Felix Lange 2024-04-26 14:04:04 +02:00
parent ea9f0a4b03
commit edb3a12a66

View file

@ -141,11 +141,12 @@ func (it *lookup) slowdown() {
func (it *lookup) query(n *node, reply chan<- []*node) {
r, err := it.queryfunc(n)
if !errors.Is(err, errClosed) {
// Avoid recording failures on shutdown.
if !errors.Is(err, errClosed) { // avoid recording failures on shutdown.
success := len(r) > 0
it.tab.trackRequest(n, success, r)
it.tab.log.Trace("FINDNODE failed", "id", n.ID(), "err", err)
if err != nil {
it.tab.log.Trace("FINDNODE failed", "id", n.ID(), "err", err)
}
}
reply <- r
}