From 18edea1c80be4f331e9d07f6fa09e1f0804570cd Mon Sep 17 00:00:00 2001 From: "Bora M. Alper" Date: Sat, 22 Feb 2020 14:26:45 +0000 Subject: [PATCH] magneticod: potential improvements to indexing service --- cmd/magneticod/dht/mainline/indexingService.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmd/magneticod/dht/mainline/indexingService.go b/cmd/magneticod/dht/mainline/indexingService.go index b4f88bb..c264b09 100644 --- a/cmd/magneticod/dht/mainline/indexingService.go +++ b/cmd/magneticod/dht/mainline/indexingService.go @@ -233,6 +233,13 @@ func (is *IndexingService) onSampleInfohashesResponse(msg *Message, addr *net.UD is.counter++ } + // TODO: good idea, but also need to track how long they have been here + //if msg.R.Num > len(msg.R.Samples) / 20 && time.Duration(msg.R.Interval) <= is.interval { + // if addr.Port != 0 { // ignore nodes who "use" port 0... + // is.routingTable[string(msg.R.ID)] = addr + // } + //} + // iterate is.routingTableMutex.Lock() defer is.routingTableMutex.Unlock()