Skip to content
This repository has been archived by the owner on Jan 21, 2022. It is now read-only.

Commit

Permalink
magneticod: potential improvements to indexing service
Browse files Browse the repository at this point in the history
  • Loading branch information
boramalper committed Feb 22, 2020
1 parent 58ef12c commit 18edea1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cmd/magneticod/dht/mainline/indexingService.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 18edea1

Please sign in to comment.