call it common prefix len

License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
This commit is contained in:
Henrique Dias 2019-12-12 17:55:50 +01:00
parent dca21f6a05
commit e4dae1c931

4
dht.go
View File

@ -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) {