aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Lange <fjl@users.noreply.github.com>2019-04-08 19:35:11 +0800
committerPéter Szilágyi <peterke@gmail.com>2019-04-08 19:35:11 +0800
commited97517ff4db1982251d8bf7dbeca565159e3604 (patch)
treeb1bd8e769d00c22d77000ccd46b5ab642d3d04ed
parent3996bc1ad91665ad30036713fba11840a36dfff0 (diff)
downloadgo-tangerine-ed97517ff4db1982251d8bf7dbeca565159e3604.tar
go-tangerine-ed97517ff4db1982251d8bf7dbeca565159e3604.tar.gz
go-tangerine-ed97517ff4db1982251d8bf7dbeca565159e3604.tar.bz2
go-tangerine-ed97517ff4db1982251d8bf7dbeca565159e3604.tar.lz
go-tangerine-ed97517ff4db1982251d8bf7dbeca565159e3604.tar.xz
go-tangerine-ed97517ff4db1982251d8bf7dbeca565159e3604.tar.zst
go-tangerine-ed97517ff4db1982251d8bf7dbeca565159e3604.zip
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.
-rw-r--r--p2p/discover/table.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/p2p/discover/table.go b/p2p/discover/table.go
index ef0c08afc..3e9353753 100644
--- a/p2p/discover/table.go
+++ b/p2p/discover/table.go
@@ -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)