From ea1d21f7e55c51dc2b0553b89a8c5fe1dcafed67 Mon Sep 17 00:00:00 2001 From: Arceliar Date: Thu, 7 Jun 2018 21:28:08 -0500 Subject: [PATCH] don't change dhtInfo.pings when sending a search, to prevent multiple different searches from evicting a node --- src/yggdrasil/search.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/yggdrasil/search.go b/src/yggdrasil/search.go index 4b9cd03a..d9dc76e3 100644 --- a/src/yggdrasil/search.go +++ b/src/yggdrasil/search.go @@ -107,7 +107,10 @@ func (s *searches) doSearchStep(sinfo *searchInfo) { // Send to the next search target var next *dhtInfo next, sinfo.toVisit = sinfo.toVisit[0], sinfo.toVisit[1:] + var oldPings int + oldPings, next.pings = next.pings, 0 s.core.dht.ping(next, &sinfo.dest) + next.pings = oldPings // Don't evict a node for searching with it too much sinfo.visited[*next.getNodeID()] = true } }