PeerId type.
Juan Batiz-Benet committed
Jul 4, 2014 at 17:35 UTC
50b7c888d50d17659ead684c43a23588ee865076
2 files changed
+7
-2
peer/peer.go
+6
-1
@@ -5,8 +5,13 @@ import (
5
mh "github.com/jbenet/go-multihash"
6
)
7
8
+type PeerId mh.Multihash
9
+
10
+// have to map string : *Peer because slices are not comparable.
11
+type PeerBook map[string]*Peer
12
+
13
type Peer struct {
9
- Id mh.Multihash
14
+ Id PeerId
15
Addresses []*ma.Multiaddr
16
}
17
peer/peer_test.go
+1
-1
@@ -26,7 +26,7 @@ func TestNetAddress(t *testing.T) {
26
return
27
}
28
29
- p := Peer{Id: mh}
29
+ p := Peer{Id: PeerId(mh)}
30
p.AddAddress(tcp)
31
p.AddAddress(udp)
32