Commit e1427950 authored by Jeromy's avatar Jeromy
Browse files

remove dependency on key

parent d68ac4ce
......@@ -11,12 +11,8 @@ import (
peer "github.com/ipfs/go-libp2p/p2p/peer"
ma "github.com/jbenet/go-multiaddr"
key "github.com/whyrusleeping/go-key"
)
// Map maps Keys (Peer.IDs) to Connections.
type Map map[key.Key]Conn
type PeerConn interface {
io.Closer
......
......@@ -7,7 +7,6 @@ import (
ks "Qma4vHVBYKDiKS5VpvtLNJHHDbL7S6VRsvxxmBnBFfKP3k/go-keyspace"
peer "github.com/ipfs/go-libp2p/p2p/peer"
key "github.com/whyrusleeping/go-key"
)
// peerMetric tracks a peer and its distance to something else.
......@@ -93,9 +92,9 @@ func (pq *distancePQ) Dequeue() peer.ID {
// NewXORDistancePQ returns a PeerQueue which maintains its peers sorted
// in terms of their distances to each other in an XORKeySpace (i.e. using
// XOR as a metric of distance).
func NewXORDistancePQ(fromKey key.Key) PeerQueue {
func NewXORDistancePQ(from string) PeerQueue {
return &distancePQ{
from: ks.XORKeySpace.Key([]byte(fromKey)),
from: ks.XORKeySpace.Key([]byte(from)),
heap: peerMetricHeap{},
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment