Skip to content

Commit

Permalink
fix: use usefulConnMgrProtectedBuckets constant
Browse files Browse the repository at this point in the history
  • Loading branch information
Stebalien committed May 21, 2020
1 parent 3b9c981 commit a79d0dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion query.go
Expand Up @@ -187,7 +187,7 @@ func (q *query) recordPeerIsValuable(p peer.ID) {
// protect _too_ many peers.
commonPrefixLen := kb.CommonPrefixLen(q.dht.selfKey, kb.ConvertPeerID(p))
cmgr := q.dht.host.ConnManager()
if commonPrefixLen < 2 {
if commonPrefixLen < usefulConnMgrProtectedBuckets {
cmgr.Protect(p, dhtUsefulTag)
} else {
cmgr.TagPeer(p, dhtUsefulTag, usefulConnMgrScore)
Expand Down

0 comments on commit a79d0dd

Please sign in to comment.