remove blacklist, peerwire, and custom bencode lib. successfully receive a request and send a response

This commit is contained in:
Alex Grintsvayg 2017-08-16 17:34:53 -04:00
parent fa8a4a59bc
commit c0290497de
9 changed files with 263 additions and 1381 deletions

View file

@ -11,7 +11,7 @@ import (
// maxPrefixLength is the length of DHT node.
const maxPrefixLength = 160
const nodeIDLength = 20
const nodeIDLength = 48
const compactNodeInfoLength = nodeIDLength + 6
// node represents a DHT node.
@ -359,11 +359,6 @@ func (rt *routingTable) Insert(nd *node) bool {
rt.Lock()
defer rt.Unlock()
if rt.dht.blackList.in(nd.addr.IP.String(), nd.addr.Port) ||
rt.cachedNodes.Len() >= rt.dht.MaxNodes {
return false
}
var (
next *routingTableNode
bucket *kbucket