Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
go-libp2p
Commits
e1427950
Commit
e1427950
authored
Nov 13, 2015
by
Jeromy
Browse files
remove dependency on key
parent
d68ac4ce
Changes
2
Hide whitespace changes
Inline
Side-by-side
p2p/net/conn/interface.go
View file @
e1427950
...
...
@@ -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
...
...
p2p/peer/queue/distance.go
View file @
e1427950
...
...
@@ -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
(
from
Key
key
.
Key
)
PeerQueue
{
func
NewXORDistancePQ
(
from
string
)
PeerQueue
{
return
&
distancePQ
{
from
:
ks
.
XORKeySpace
.
Key
([]
byte
(
from
Key
)),
from
:
ks
.
XORKeySpace
.
Key
([]
byte
(
from
)),
heap
:
peerMetricHeap
{},
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment