Skip to content

Commit

Permalink
p2p/discover: bump failure counter only if no nodes were provided (#1…
Browse files Browse the repository at this point in the history
…9362)

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.
  • Loading branch information
fjl authored and karalabe committed Apr 8, 2019
1 parent 3996bc1 commit ed97517
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion p2p/discover/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ func (tab *Table) findnode(n *node, targetKey encPubkey, reply chan<- []*node) {
// Avoid recording failures on shutdown.
reply <- nil
return
} else if err != nil || len(r) == 0 {
} else if len(r) == 0 {
fails++
tab.db.UpdateFindFails(n.ID(), n.IP(), fails)
log.Trace("Findnode failed", "id", n.ID(), "failcount", fails, "err", err)
Expand Down

0 comments on commit ed97517

Please sign in to comment.