remove blacklist, peerwire, and custom bencode lib. successfully receive a request and send a response
This commit is contained in:
parent
fa8a4a59bc
commit
c0290497de
9 changed files with 263 additions and 1381 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue