Commit 70ea4f54 authored by Juan Batiz-Benet's avatar Juan Batiz-Benet Committed by Brian Tiger Chow

added peerstore to core

parent 9c6a3b20
...@@ -34,8 +34,8 @@ type IpfsNode struct { ...@@ -34,8 +34,8 @@ type IpfsNode struct {
// the local node's identity // the local node's identity
Identity *peer.Peer Identity *peer.Peer
// the map of other nodes (Peer instances) // storage for other Peer instances
PeerMap *peer.Map Peerstore *peer.Peerstore
// the local datastore // the local datastore
Datastore ds.Datastore Datastore ds.Datastore
...@@ -78,6 +78,8 @@ func NewIpfsNode(cfg *config.Config, online bool) (*IpfsNode, error) { ...@@ -78,6 +78,8 @@ func NewIpfsNode(cfg *config.Config, online bool) (*IpfsNode, error) {
return nil, err return nil, err
} }
peerstore := peer.NewPeerstore()
var ( var (
net *inet.Network net *inet.Network
// TODO: refactor so we can use IpfsRouting interface instead of being DHT-specific // 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) { ...@@ -125,7 +127,7 @@ func NewIpfsNode(cfg *config.Config, online bool) (*IpfsNode, error) {
return &IpfsNode{ return &IpfsNode{
Config: cfg, Config: cfg,
PeerMap: &peer.Map{}, Peerstore: peerstore,
Datastore: d, Datastore: d,
Blocks: bs, Blocks: bs,
DAG: dag, DAG: dag,
......
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