Skip to content

Commit 9d9c6b5

Browse files
fjlkaralabe
authored andcommitted
p2p/discover: bump failure counter only if no nodes were provided (#19362)
This resolves a minor issue where neighbors responses containing less than 16 nodes would bump the failure counter, removing the node. One situation where this can happen is a private deployment where the total number of extant nodes is less than 16. Issue found by @Jsying.
1 parent 8ca6454 commit 9d9c6b5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

p2p/discover/table.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ func (tab *Table) findnode(n *node, targetKey encPubkey, reply chan<- []*node) {
313313
// Avoid recording failures on shutdown.
314314
reply <- nil
315315
return
316-
} else if err != nil || len(r) == 0 {
316+
} else if len(r) == 0 {
317317
fails++
318318
tab.db.UpdateFindFails(n.ID(), n.IP(), fails)
319319
log.Trace("Findnode failed", "id", n.ID(), "failcount", fails, "err", err)

0 commit comments

Comments
 (0)