diff options
author | Felix Lange <fjl@users.noreply.github.com> | 2019-04-08 19:35:11 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2019-04-08 19:35:50 +0800 |
commit | 9d9c6b5847bfd1267c2fee60f5a5b05bdaaf4216 (patch) | |
tree | 3015c64b71498d53ffe3f9707c9cdcbfb4be6c86 /p2p | |
parent | 8ca64548077edb527b903058db876a4ec3771349 (diff) | |
download | go-tangerine-9d9c6b5847bfd1267c2fee60f5a5b05bdaaf4216.tar go-tangerine-9d9c6b5847bfd1267c2fee60f5a5b05bdaaf4216.tar.gz go-tangerine-9d9c6b5847bfd1267c2fee60f5a5b05bdaaf4216.tar.bz2 go-tangerine-9d9c6b5847bfd1267c2fee60f5a5b05bdaaf4216.tar.lz go-tangerine-9d9c6b5847bfd1267c2fee60f5a5b05bdaaf4216.tar.xz go-tangerine-9d9c6b5847bfd1267c2fee60f5a5b05bdaaf4216.tar.zst go-tangerine-9d9c6b5847bfd1267c2fee60f5a5b05bdaaf4216.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.
Diffstat (limited to 'p2p')
-rw-r--r-- | p2p/discover/table.go | 2 |
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) |