Skip to content

Commit

Permalink
call it common prefix len
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
  • Loading branch information
hacdias committed Dec 12, 2019
1 parent dca21f6 commit e4dae1c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dht.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ func makeDHT(ctx context.Context, h host.Host, dstore ds.Batching, protocols []p
cmgr := h.ConnManager()

rt.PeerAdded = func(p peer.ID) {
dist := kb.CommonPrefixLen(self, kb.ConvertPeerID(p))
cmgr.TagPeer(p, "kbucket", 5+dist)
commonPrefixLen := kb.CommonPrefixLen(self, kb.ConvertPeerID(p))
cmgr.TagPeer(p, "kbucket", 5+commonPrefixLen)
}

rt.PeerRemoved = func(p peer.ID) {
Expand Down

0 comments on commit e4dae1c

Please sign in to comment.