added peerstore to core
Juan Batiz-Benet committed
Sep 16, 2014 at 05:50 UTC
70ea4f540c717d43037606c4e6e36d55489324b6
1 file changed
+5
-3
core/core.go
+5
-3
@@ -34,8 +34,8 @@ type IpfsNode struct {
34
// the local node's identity
35
Identity *peer.Peer
36
37
- // the map of other nodes (Peer instances)
38
- PeerMap *peer.Map
37
+ // storage for other Peer instances
38
+ Peerstore *peer.Peerstore
39
40
// the local datastore
41
Datastore ds.Datastore
@@ -78,6 +78,8 @@ func NewIpfsNode(cfg *config.Config, online bool) (*IpfsNode, error) {
78
return nil, err
79
}
80
81
+ peerstore := peer.NewPeerstore()
82
+
83
var (
84
net *inet.Network
85
// TODO: refactor so we can use IpfsRouting interface instead of being DHT-specific
@@ -125,7 +127,7 @@ func NewIpfsNode(cfg *config.Config, online bool) (*IpfsNode, error) {
127
128
return &IpfsNode{
129
Config: cfg,
128
- PeerMap: &peer.Map{},
130
+ Peerstore: peerstore,
131
Datastore: d,
132
Blocks: bs,
133
DAG: dag,