From e5bb9bcb8dadc3cadd46df7f4d5651fbebbd17ce Mon Sep 17 00:00:00 2001 From: Arceliar Date: Fri, 26 Jul 2019 17:44:40 -0500 Subject: [PATCH] change how searches are initialized so we actually send a dhtReq to ourself and get a response, in case we're the destination --- src/yggdrasil/search.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/yggdrasil/search.go b/src/yggdrasil/search.go index d8c9049..4c31fd6 100644 --- a/src/yggdrasil/search.go +++ b/src/yggdrasil/search.go @@ -179,8 +179,12 @@ func (sinfo *searchInfo) continueSearch() { // Calls create search, and initializes the iterative search parts of the struct before returning it. func (s *searches) newIterSearch(dest *crypto.NodeID, mask *crypto.NodeID, callback func(*sessionInfo, error)) *searchInfo { sinfo := s.createSearch(dest, mask, callback) - sinfo.toVisit = s.core.dht.lookup(dest, true) sinfo.visited = make(map[crypto.NodeID]bool) + loc := s.core.switchTable.getLocator() + sinfo.toVisit = append(sinfo.toVisit, &dhtInfo{ + key: s.core.boxPub, + coords: loc.getCoords(), + }) // Start the search by asking ourself, useful if we're the destination return sinfo }